To obtain the binary access image in MySQL, I have to output the first image and cannot output it cyclically?

Source: Internet
Author: User
Obtain binary access images in MySQL. only the first image can be output, and the result cannot be output cyclically ?? The image is saved to the database in binary format, and the first image can be output in the browser without the while loop. after it is used, the output is garbled, is there no output before the output image ?? I checked a lot and it didn't work. could you please advise PHPcode & lt ;? Phprequire_once (& quot; obtain the binary access image in MySQL. only the first image can be output, but cannot be output cyclically ??
The image is saved to the database in binary format, and the first image can be output in the browser without the while loop. after it is used, the output is garbled, is there no output before the output image ??
I checked a lot and it didn't work. please give me some advice.

PHP code
  
   
  
  


------ Solution --------------------
In other words, Content-Type: image/jpeg declares that the response Content is a byte stream. Your code also outputs the ghost stream, which naturally leads to the inability of the browser to accurately identify and convert the code.
To display multiple images in a browser, you must follow the HTML format standard. The src attribute of the img tag supports various protocols, such as file: // http: // data: //, but cannot be directly filled with the byte stream of the image.

I still hope you will not be hanging on this tree. You can use this meaningless and unreasonable project to train your hands. not only will you not gain anything, but it will make you learn more and more confused.
------ Solution --------------------
My previous understanding of streaming is also problematic. if you have time, please refer to the correct explanation:
Mime type definitions declared by http://zh.wikipedia.org/zh/MIME Content-type
If the content-type is image/jpeg, the subsequent response content can only be understood as a jpeg image.
However, if the response content is text/html, the browser will parse the content as an HTML document. the HTML tag has its own meaning, and the img tag will be used for displaying the image, the src attribute specifies where the image is loaded.
Http: // The url followed by the request is required to be downloaded from the server. this will initiate another request.
File: // The file address is specified to be read from the local file system, which can only read local files.
Data: // see rfc2397 for texts in special formats.

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.