Keep the image fingerprint (a string of garbled characters) to mysql for analysis-php Tutorial

Source: Internet
Author: User
Save the image fingerprint (a string of garbled characters) to mysql, find and analyze this post, and then edit it by jj1__jj at 2013-08-0815: 10: 59. & nbsp; the image fingerprint is as follows: SQL: & nbsp; update & nbsp; test & nbsp; set & nbsp; 'bitmap' & nbsp; fill + W & amp; + N {| Ox0: save the image fingerprint (a string of garbled characters) to mysql for analysis.

This post was last edited by jj1__jj at 15:10:59

The image fingerprints are as follows:



SQL:

Update test set 'bitmap' = 'salary + W & + N {| \ 0Ox0 \ $8) sld \ "Z | y | \ 0ZZ! \ 0] P! Zw \ Z \ Zgm | p \ "y ^ W |) Q, \ 0xc {\ 0 \ Z \ [#] pEXcto [ER '\ 'L {B & 8P8j [w1y ^ t | d0YSMK! [Sj \ 0Kyww7) PE \ ZIPv ^ m | \ 0 \ 0 \ 0 {\ 0PK ^ \ 0y | x-e ^ | jcxc | 'n' where id = 168;

The bitmap field is varchar 255.
A strange thing is that an error is reported when you run SQL directly in php:

$query = "update test set `bitmap` ='".mysql_real_escape_string($bitmap)."' where id = {$picture['id']};";
1366: Incorrect string value: '\xDD[+W&+...' for column 'bitmap' at row 1


It is okay to directly copy the SQL statement to the mysql client. Currently, when we think it is copy, the fingerprint garbled text cannot be copied completely, or it has changed,
If you do not add mysql_real_escape_string, but save the fingerprint garbled characters to the text, you cannot copy it and paste only the part.
Thank you very much for your analysis.

MySQL garbled

Share:


------ Solution --------------------
Saves base64 encoding, saving you trouble

Save directly, the bitmap field must be binary
But it is not guaranteed that the storage will succeed.

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.