image posting

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
swissbeets
Forum Newbie
Posts: 20
Joined: Thu Jun 26, 2008 7:56 pm

image posting

Post by swissbeets »

i am tryin to have the image that applies to a product be displayed at the same time and also be able to be updated and added together. So i have a products table already with the primary key being product_id i made an images table and set the primary key to product_id also then the only other field in this table is the image(blob) does this seem like it will work? also any ideas or other help would be great i am still kind of confused on the issue
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: image posting

Post by Kieran Huggins »

it's generally agreed that images should be stored in the filesystem, and you should store the path to the image in the DB.
swissbeets
Forum Newbie
Posts: 20
Joined: Thu Jun 26, 2008 7:56 pm

Re: image posting

Post by swissbeets »

thats what i heard but i have already begun doing it this way, thank you but i think i am going to change it on the next website i just want to get this working for now does that logic make sense eventhough it is not the best way to do it?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: image posting

Post by onion2k »

What you've suggested will work, no problem there, but it's actually more complicated to code than the 'right' way storing the images as files, especially if you're a bit new to PHP. I would recommend changing your approach now rather than leaving it till the next site.
swissbeets
Forum Newbie
Posts: 20
Joined: Thu Jun 26, 2008 7:56 pm

Re: image posting

Post by swissbeets »

ok will do, do you know of any tutorials and just so i know, could you give me an example of how the picture will be displayed?
Post Reply