Php stores images in binary format into the mysql database. how can this problem be solved?

Source: Internet
Author: User
Php saves images in binary format to mysql database. some images need to be saved to mysql database. how can this problem be solved? & Lt ;? Php & nbsp; $ DBserver = & quot; localhost & quot; $ DBname = & quot; new & quot; $ DBuse php saves the image in binary format to the mysql database
Some images need to be stored in the mysql database. how can this problem be solved?


$ DBserver = "localhost ";
$ DBname = "new ";
$ DBuser = "root ";
$ DBpassword = "";

$ Con = mysql_connect ("localhost", "root ","");

...

?>

------ Solution --------------------
PHP code
  
  Untitled DocumentDisplay images in mysql
  

"; Print"

No such image!

"; Exit () ;}$ row = @ mysql_fetch_row ($ res); header (" Content-type: image/"); echo $ row [1];?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.