PHP MySQL example: image gallery (blob-storage) – Source anyexample.com
I wanted to store an image in mysql tables. Just googled, and got a working example from anyexample.com. A minor change is required for the script. Instead of
it should be
Here is the script details reproduced from original page:
This is a simple example of photo-gallery script, which uses MySQL table (BLOB field) to store images. Trivial password-protection, uploading and deleting images are supported. For Apache-version of PHP there is advanced browser-caching support (using If-Modified-Since header).
compatible
* PHP 4.3.0 or higher
* PHP 5
There are three notable parts of the script:
* main page generation –
generates HTML code for the list of uploaded photos, forms for photo deletion and uploading
* image uploading –
processes POST request: checks password, uploads photo to database or deletes it
* image showing –
Fetches image information from MySQL database and sends image do browser. If PHP is installed as mod_php (for Apache), does If-Modified-Since HTTP header checking.
Here is the working example http://www.notesbit.com/download/test/blob/ae_gallery.php. Of course password is different, as I do not want to get my server crashed!!

Comments
No comments yet.