What is in the “shot” column, is it the actual file name of the image or the actual image?
The idea is to put the correct path to the image into the src attribute of the img tag.
The example code I provided may not work as a straight copy as I’m not party to your exact setup, you will probably need to modify it to suit.
Blob is used for storing binary data, but you say:-
If the image files are in a folder there is no need to store the image data in the database too. You only need store a reference to the file which will be a string, so may be stored in a text data type column such as varchar or similar.
So for example you have the image file: /images/air-sea-battle.jpg on your server.
All you need to store in the database is the filename as a simple text string: air-sea-battle.jpg
Alternatively you could make the filename a number matching the game’s ID, Eg: 248.jpg then you don’t even need to store any reference to the image, just build the file path from the known folder, the ID number then the extension.
It depends on what naming convention you have for the image files, you probably don’t want to edit 500 image file names to match IDs.
It’s not that it’s impossible to get the image data from the database (if it’s too much work to alter yuor tables and data) but TBH I don’t know exactly how as it’s something I have never done or thought of doing.
I imagine it involves some kind of base64_encode or suchlike.
I prefer to keep “heavy data” like images out of the database and just reference a file saved on the server for simplicity and efficiency.
It’s not just a case of changing the columns data type, you would also change the data stored to be a file name string.