Quick question about images, mysql

BeauJangles

Lifer
Aug 26, 2001
13,941
1
0
I have users, when they register upload an image which is then thumbnailed and the non-thumb and thumbed versions are stored on my server.

the naming convention is as follows:

GraduationYear_Lastname_filename

the thumbs look like this:

GraduationYear_Lastname_THUMBNAIL_filename

Now, I have been storing just the path to the full sized image in the mysql database but when I go to display the picture I also need the path to the thumbed version. How should I go about getting this? I was going to stick the THUMBNAIL tag at the beginning of the file and then just add "THUMBNAIL" to the front of the original file name when I wanted to query it... is this the easiest way? I could also create a second column in the table for the thumbnail path... but that seems pretty unnecessary.

thanks!
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Well yeah, manipulating the string seems to be the easiest way. Another column would only be necessary if you wanted to allow for thumbnails that didn't fit the pattern.