首页 > 数据库技术 > 详细

解决mysql的错误 CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1300 Invalid utf8 character string: '\xBF\xA5'

时间:2017-07-11 17:17:26      阅读:3176      评论:0      收藏:0      [点我收藏+]

 

报错:

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'

原文:http://www.cnblogs.com/meiping/p/7151278.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!