Reading binary images from the database

Source: Internet
Author: User
What is the problem about reading binary images from a database ;? Php $ conn = mssql_connect (& quot; 192.168.1.70 & quot;, & quot; XXX & quot;, & quot; 123 & quot;) ordie (& quot; database opening error & quot;); mssql_sel display of binary image reading from database
$ Conn = mssql_connect ("192.168.1.70", "XXX", "123") or die ("database opening error ");
Mssql_select_db ("XXX ");
Mssql_query ("set names utf8 ");

$ SQL = "SELECT top 1 * FROM sync_info_BlogPic ";

$ Result2 = mssql_query ($ SQL );
Header ("Content-Type: image/jpg ");
$ Row2 = mssql_fetch_object ($ result2 );

Echo $ row2-> BlogPic_Content;



Error: Image Upload UPT or truncated



------ Solution --------------------
Error: image damaged or truncated

What type of fields do you use to save images?
------ Solution --------------------
How to read is not important, how to save it?
------ Solution --------------------
It must have been an issue with warehouse receiving. don't think about it.
------ Solution --------------------
The buffer provided by php to mssql may be too small.
------ Solution --------------------
Php. ini

[MSSQL]
; Valid range 0-2147483647. Default = 4096.
; Mssql. textlimit = 4096

; Valid range 0-2147483647. Default = 4096.
; Mssql. textsize = 4096

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.