Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
phppick
Forum Commoner
Posts: 57 Joined: Thu Aug 14, 2003 5:59 am
Post
by phppick » Tue Jan 13, 2004 3:05 am
How to Store Image in Postgres Database? Which DataType i need to Use. I am using Postgres 7.4
How to retrive it to display in Web, I am using PHP.
Thanks
markbeadle
Forum Commoner
Posts: 29 Joined: Tue Dec 02, 2003 2:50 am
Location: Aachen, Germany
Post
by markbeadle » Tue Jan 13, 2004 4:52 am
Not sure of the answer but a quick question..
Do you really need to store the image within the database or should you store a pointer and image details within the database and use the filesystem to store the image itself ?
Just an alternative
fractalvibes
Forum Contributor
Posts: 335 Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas
Post
by fractalvibes » Tue Jan 13, 2004 10:02 pm
Use a BLOB to store images. Could be more efficient to just store the link the the image in the database - depends upon the circumstances.
To retrieve, just query the database as usual, and have a script that handles retrieval, setting a header with the proper content type.
fv
phppick
Forum Commoner
Posts: 57 Joined: Thu Aug 14, 2003 5:59 am
Post
by phppick » Wed Jan 14, 2004 3:19 am
Thanks for the Help