Jump to content

Archived

This topic is now archived and is closed to further replies.

drranch

I have Image upload questions....

Recommended Posts

???

Hello all!

I'm not sure I understand this image upload process for PHP/MYSQL....

I undestand that you can upload an image to a folder, but how do you tie the item in the MYSQL database to it's specific image? 

???

Share this post


Link to post
Share on other sites
Hi,

Store the filename.extension in your databse .. then you use that to match the image name to the image

[code=php:0]<img src="'.$images_dir.'/'.$row['photo_filename'].'">';[/code]


hth

Share this post


Link to post
Share on other sites
The "$images_dir.."  would that be where my host provider set up the temp directory for?

Host php.ini configuration...

upload_tmp_dir C:\WINDOWS\Temp

Share this post


Link to post
Share on other sites
I think I found a pretty good tut on this...after reading the first two pages your advise is more clear in my head!

http://codewalkers.com/tutorials/35/1.html

Thank you for your knowledge and time!

Share this post


Link to post
Share on other sites
Hi,

Looks like that tut shows how to store the images within the database .. Im sure the best option is to store the name+extension in the database and the photo/file in a folder on the server.

Post what code you have if you get stuck.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.