Home > Backend Development > PHP Tutorial > PHP processing code for extracting binary images from the database_PHP tutorial

PHP processing code for extracting binary images from the database_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:44:46
Original
1002 people have browsed it

image.php file

Copy code The code is as follows:

$conn=@mysql_connect(" localhost","root","123") or die("Server connection error!"); //Link database
@mysql_select_db("upload",$conn) or die("No database found!");
$query="select * from upfile where ftag=$fn";
$result=mysql_query($query);
if(!$result) die("error: mysql query");
$num=mysql_num_rows($result);
if($num<1) die("error: no this recorder");
$data = mysql_result($result,0,"picture");
header("Content-type: image/JPEG",true);
echo $data;
?>

The above is the image extraction
frontend display file
Copy code The code is as follows:


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320489.htmlTechArticleimage.php file copy code code is as follows: ?php $conn=@mysql_connect("localhost","root" ,"123") or die("Server connection error!"); //Link database @mysql_select_db("upload",$conn) o...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template