Quote:
|
Originally Posted by coatsey
I need someassistance or a guidance in some php/mysql coding if there is any body out there.
I am currently designing a database driven website where users log in and out etc. Once logged in there is a form where users can fill out and upload a picture of their car and submit it into a mysql database. First of all how would i go about inserting an image and text into a table into a mysql database. Also once the user has done this i would like them to view what they have just done. How would i go about that?
Thanks
|
Just use the BLOB field type, read the temp file generated by the upload, add slashes to it (otherwise it could contain "dangerous" characters) and insert it into the blob field.
To display the image create a php file that sends a Content type header with image/jpeg or gif or whatever you are going to use and "echo" the results.
The other solution (storing them in a directory) is fine, but you would need to make that directory writeable by the webserver, and that can be kinda risky. If you have a nice box to deploy a huge database then go on and use the blob field.