As you'll probably see in a lot of responses, it might be better to store
the pictures in a folder on the server and store only the path to the
pictures in the db.  That keeps the size of the db smaller.

If you choose to do that, use an HTML form with
enctype="multipart/form-data" and an input type="file" element, send it to a
PHP script to upload the file, move it to a specified directory and put the
path and the filname in a table in your db. Then, when you need to display
an image, just grab the path and insert it in an <img src=""> tag.

I don't know how to store an image directly in a database since I always
store just the path. Sorry.

-----Original Message-----
From: Seabird [mailto:jacco@;]
Sent: Tuesday, November 12, 2002 11:56 AM
Subject: [PHP-DB] small database

Hi everyone,

I'm creating a sample site for a company that does aircraft sales. I use a
MySQL DB to store all the info of the available aircraft. Now, I would like
to store pictures directly inside that same table, so that on the "details"
page, it would provide a picture out of (for example) Field5. Is this
possible and if so how? (I tried blob etc., but can't get it to work).


Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching????

PHP Database Mailing List (
To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to