在程序中使用 mysql_query("set sql_mode='ANSI'"); 将mysql的sql mode模式修改为标准模式 或者修改my.ini(my.cnf)中的sql-mode值修改 my.ini 文件.# Set the SQL mode to strict sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”改为:# Set the SQL mode to strict sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
<?php
echo iconv("utf-8", "gb2312", $content);
?>
然后再保存到数据库。。
mysql_query("set sql_mode='ANSI'");
将mysql的sql mode模式修改为标准模式
或者修改my.ini(my.cnf)中的sql-mode值修改 my.ini 文件.# Set the SQL mode to strict
sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”改为:# Set the SQL mode to strict
sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”