raghav472 — 2013-07-03T06:18:23-04:00 — #1
How to upload an image into database?
rubble — 2013-07-03T07:36:40-04:00 — #2
If you use advanced search > Titles only and search for "photo database" there are 140 results.
Also you could do with suppling more information like are you putting the path into the database or the image; are you resizing etc. as well; are you using a form and if so how many images at once?
vectorialpx — 2013-07-03T08:56:24-04:00 — #3
However, long story short: you need a [blob] field, add into it a base64_encode of file_get_contents( image ) and for display, use header('Content-type: image/jpg'); (or whatever)
avram — 2013-07-03T09:21:12-04:00 — #4
Or even better, do NOT store images in the database. Store them on disk, and put only image file name in the database. Unless you have a homework or something like that where you need to practice such things...
vectorialpx — 2013-07-03T19:23:39-04:00 — #5
True, this is a bad practice for so many reasons - first two, if you need examples: scalability and performance.
anil14353 — 2013-07-04T03:35:54-04:00 — #6
you can upload in to directory and save the path in a field and then fetch data display it.