Forum Moderators: coopster

Message Too Old, No Replies

Dynamic pictures

How to produce?

         

johnnydequino

12:34 am on Dec 23, 2003 (gmt 0)

10+ Year Member



I am making very good headway with the book suggested here on this thread - webmaster world and PHP is awesome!

One question that I cannot figure out - I am using PHP and mysql. I created my database design. When a customer enters in a phone number, I want to return a table. I can do this. But column number #1 is a .gif, or a picture of the person. Do I embed the URL for the .gif in the table as a value I select?

Hope this was not too 'foggy'. After 3 days of studying, I have gone from a 1 beginnner in PHP to a 2. =)

jd

willybfriendly

12:48 am on Dec 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That is how I do it - store the location of the picture in the DB.

It is possible to store the picture as a blob, but it uses significantly more resources.

WBF

dcrombie

4:48 pm on Dec 26, 2003 (gmt 0)



Rename the images to match the database record ids (eg. 1.jpg, 2.jpg, etc.). That way you don't need to store any information about the image in the database - you can just check if the image file exists when displaying a record. It also avoids any naming conflicts on the server.
;)