MySQL help!
August 27, 2006 10:07 PM
Subscribe
Please help me create a MySQL database from a collection of images. There is of course
I have a folder which contains some subfolders. Each of these subfolders contains 100-200 images. These images are all numbered in the format #########.jpg, and each photo has a unique name. In other words, there is no photo in folder X which has the same filename as a photo in folder Y, for all X and Y.
What I want to do is add these photos information to a MySQL database on my local machine (I have a WAMP setup). I want to enter the following information.
ID# - this is the filename of the image but without the .jpg tag. In other words, image 000001307.jpg should have an ID of 000001307
description - the description needs to be the same as the name of the folder is in. So if a file is in folder "School" it needs to have a description of "School".
filename - simply foldername/filename for the image.
How can I set up some sort of loop to automatically create all the entries needed in a MySQL table? There is only ~10 folders of images, so even if I had to set up a new script for each folder, that wouldnt be too bad.
Please help save me the time of manually enterring 1300 entries into a DB!
posted by LoopyG to computers & internet (10 comments total)
1 user marked this as a favorite
posted by null terminated at 10:34 PM on August 27, 2006