Hello,
I've been given a recent project for a website and am having a difficult time wrapping my head around some of the MySQL processes. I haven't used MySQL much, so I apologize ahead of time for any ignorance.
I believe that I am going to be actually storing the images inside MySQL. Here is my confusion, I think. And, forgive, I have been pouring over PHP/MySQL tutorials, but they always address only one or the other, with regard to forms and upload pages. I would like to create an upload/edit page, that allows my customer to basically add an entry (almost like a news feed, I guess), as well as upload an image. I want the rows to all be tabled down the page, like they are here:
http://www.nwtillers.com/equipment.html
Can I upload a file, INSERT data (or UPDATE, if I create an edit option), all with the same SUBMIT button, then have it dynamically rendered on, say 'equipment.php'.
So far, how I am assuming that this will work, is that I'll have an update.php file, with the actual form,
that sends to a process.php file, that uploads/inserts the data into the database and forwards to an updated.php form, that just prints out if the upload/update was successful.
I am assuming/hoping, that then equipment.php will have been updating to look as it does now, but with this new feature.
I have some code that I'm working on, but I'm still having trouble wrapping my brain around it. I'm not wanting anyone to do my work, more just wanting to know if I'm just looking at the wrong tutorials/missing some functions/or entirely missing some steps. Thanks for the responses!
Matthew
PHP/MySQL storing/viewing images?
Moderator: General Moderators
-
julien.duponte
- Forum Newbie
- Posts: 2
- Joined: Thu Apr 14, 2011 1:25 pm
Re: PHP/MySQL storing/viewing images?
Images are usually just uploaded in a folder with a unique file name.
you store your data concerning the image including an id and where to find the file again when needed from your page displaying your image or the page updating the data.
I am using an upload folder where my upload script stores the image uploaded. If you have different users or various site admins uploading you could define a different upload folder for each user.
From there comes a action script asking what to do with the image - add to database move it to it's final location making sure the file name is unique.
Hope I could straighten up yout thoughts a bit.
you store your data concerning the image including an id and where to find the file again when needed from your page displaying your image or the page updating the data.
I am using an upload folder where my upload script stores the image uploaded. If you have different users or various site admins uploading you could define a different upload folder for each user.
From there comes a action script asking what to do with the image - add to database move it to it's final location making sure the file name is unique.
Hope I could straighten up yout thoughts a bit.