Save Picture Fingerprint (a string of garbled characters) to MySQL, seek analysis
This post was last edited by jj___jj on 2013-08-08 15:10:59
Everybody big, picture fingerprint is as follows:
SQL is:
Bitmap field varchar 255
Very strange thing, directly PHP running SQL, will be error:
$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
Direct copy of this SQL to the MySQL client execution, is no problem. At present, it is copy of the time, this piece of fingerprint garbled can not copy complete, or has changed,
If you do not add mysql_real_escape_string, but to save the fingerprint garbled to the text, it is not possible to copy the only part of the paste.
Ask the big help analysis, thank you very much. MySQL garbled
Share to:
------Solution--------------------
Save Base64 code to avoid all worries
is saved directly, the bitmap field must be binary
But there is no guarantee that it will be stored successfully