Home  >  Article  >  Backend Development  >  保留图片指纹(一串乱码)到mysql, 求分析

保留图片指纹(一串乱码)到mysql, 求分析

WBOY
WBOYOriginal
2016-06-13 12:40:31735browse

保存图片指纹(一串乱码)到mysql, 求分析

本帖最后由 JJ___JJ 于 2013-08-08 15:10:59 编辑 各位大大, 图片指纹如下:

<br />

sql为:
<br />
 update test set `bitmap` ='蒇+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; <br />

bitmap字段为varchar 255
很奇怪的一件事, 直接php运行sql, 会报错:
<br />
$query = "update test set `bitmap` ='".mysql_real_escape_string($bitmap)."' where id = {$picture['id']};";<br />
1366: Incorrect string value: '\xDD[+W&+...' for column 'bitmap' at row 1<br />


直接copy这段sql去mysql客户端执行, 是没问题的. 目前认为是copy的时候, 这段指纹乱码没有能copy完整, 或者已经变了,
如果不加mysql_real_escape_string, 而是将指纹乱码保存到文本, 是无法copy出来 只能粘贴处部分. 
求大大们帮忙分析, 非常感谢.
MySQL 乱码
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article: 除开斜杠 Next article: 数组重组,该怎么处理