I have a database table (id, name) and added the field "photo" so now its (id, name, photo). The reason I have done this is, I was manually uploading the photo files for each entry and displaying them with php by their id number. And now with the photo field I have made it possibly to store the images in a database.
So say I have:
id name photo
23 family myfamilypic.jpg
Right now I have over 400 entries in the database with a blank photo field. What can I do with mysql to auto add the photo field based on the id field.
For example:
Current database
id name photo
1 blue
2 red
3 green
4 purple
I would like it to do this:
id name photo
1 blue 1.gif
2 red 2.gif
3 green 3.gif
4 purple 4.gif
Hopefully this makes sense? If not let me know. All files are .gif as well so no need to worry about the file extension when auto adding the photo field