首页 > 代码库 > 解决mysql的错误 CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1300 Invalid utf8 character string: '\xBF\xA5'
解决mysql的错误 CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1300 Invalid utf8 character string: '\xBF\xA5'
报错:
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1300 Invalid utf8 character string: ‘\xBF\xA5‘
解决方法:
$currentPrice = $currentPrice * 1;
=> $currentPrice 原本是字符串的 数字,导致插入数据库失败。
=》所以只要改成 数字 即可。
=》字符串的 数字 ,乘以 1 就会变成 数字类型。
但是有报告了一个Php的错误:
Internal Server Error
Division by zero
An internal error occurred while the Web server was processing your request. Please contact the webmaster to report this problem.
Thank you.
先打开错误信息验证:
ini_set
(
‘display_errors‘
,
‘on‘
);
error_reporting
(E_ALL);
解决mysql的错误 CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1300 Invalid utf8 character string: '\xBF\xA5'
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。