PHP Classes

PHP Image MySQL PDO: Save and show image from MySQL blob using PDO

Recommend this page to a friend!
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 786 All time: 4,320 This week: 238Up
Version License PHP version Categories
image-db-pdo 0.2GNU General Publi...5PHP 5, Databases, Files and Folders


This class can save and show image from MySQL blob using PDO.

It can take an image from a file or uploaded via a form and inserts a record in a given MySQL table using PDO prepared query pulling the file data into a BLOB field.

The class can execute a SELECT query to read a previously stored image file from the same database table and serves it as the current script output with a content type also stored in the same MySQL database table record.

Picture of mehrdad seifzadeh
  Performance   Level  
Name: mehrdad seifzadeh <contact>
Classes: 1 package by
Country: United States United States
Age: 35
All time rank: 2668363 in United States United States
Week rank: 483 Up46 in United States United States Up

  Files folder image Files  
File Role Description
Plain text file db_schema.sql Example sample table structure
Plain text file example.php Data main of example run to save(sample save form)
Plain text file example_save_image.php Example example of save image to database
Plain text file example_show_image.php Example example of show image
Plain text file img2db_pdo.class.php Class the main class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,320
This week:238Up