$jxjmysql->query("update ".$tabname." set content='垟' where id='5'"); 这样就出错:Fatal error: Uncaught exception 'Exception' with message 'Incorrect string value: '\x88\x94' for column 'content' at row 1 in SQL$jxjmysql->query("update ".$tabname." set content='羊' where id='5'"); 这样就可以,不会出错!
$content = mysql_escape_string('羊'); $jxjmysql->query("update ".$tabname." set content='{$content}' where id='5'"); 这样先试试,至于为什么会这样我也不知道,很奇怪,坐等高人
你的数据库的编码是 gb2312 的,当然不能保存 “垟” 因为“垟”是 gbk 字符
错误信息中 Fatal error: Uncaught exception 'Exception' with message 'Incorrect string value: '\x88\x94' for column 'content' at row 1 in SQL的 \x88\x94 是 垟 的GBK内码如果程序文件是 utf-8 编码的,那么 gbk 编码的文字从哪里来的?
这样就出错:Fatal error: Uncaught exception 'Exception' with message 'Incorrect string value: '\x88\x94' for column 'content' at row 1 in SQL$jxjmysql->query("update ".$tabname." set content='羊' where id='5'");
这样就可以,不会出错!
$jxjmysql->query("update ".$tabname." set content='{$content}' where id='5'");
这样先试试,至于为什么会这样我也不知道,很奇怪,坐等高人
因为“垟”是 gbk 字符
Fatal error: Uncaught exception 'Exception' with message 'Incorrect string value: '\x88\x94' for column 'content' at row 1 in SQL的 \x88\x94 是 垟 的GBK内码如果程序文件是 utf-8 编码的,那么 gbk 编码的文字从哪里来的?