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 <braulio@buayacorp.com>
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];