Show An Image From MySQL Blob Using PHP
Show An Image From MySQL Blob Using PHP
php
/*
Show an image from MySQL blob using PHP
Braulio Andrés Soncco Pimentel <[email protected]>
http://www.buayacorp.com/
*
This script is under Creative Commons license
http://creativecommons.org/licenses/by/2.0/
*/
Error level
error_reporting(E_ALL);
// Constants
Database server
localhost
database name
test
Database user
root
Database password
DBPASSWORD
Database Connection
Failed to connect to MySQL: Access denied for user 'DBUSER'@'localhost' (using password: YES)
The image
$image = $data[0];
The mime type of the image
$datos[1];