Forums

This topic is locked

holding images in sql with php

Posted 19 Oct 2006 01:00:47
1
has voted
19 Oct 2006 01:00:47 Marcus Haynes posted:
Hi folks.

This is my first time working with mysql and php but so far all is going well.
I've created an input form for a bunch of info on a mysql table but now I want my users to be able to upload an image.
naturally I want to use this on another php page later.
First though I'm not sure how to store it.
what I imagine is that the file gets put in a folder on the server and the the database holds that path and filename.
but to do that I have to do 2 things at once.
1 put the file somewhere
2 put the the path and name into my table

I think I can fiqure out 1 but how can I do 2 as well.
btw I'm using dreamweaver 8, myphpadmin and mysql

Cheers

Replies

Replied 19 Oct 2006 19:29:59
19 Oct 2006 19:29:59 Roddy Dairion replied:
You don't need to put the path in the sql table just the file name will. Then when you have to read it all you have to do is retrieve the filename and add the path to it.

Reply to this topic