简体   繁体   English

变量“ sql_mode”不能设置为“ REPLACE”的值

[英]Variable 'sql_mode' can't be set to the value of 'REPLACE

I don't know why but suddenly I getting the following error. 我不知道为什么,但是突然出现以下错误。

Till now it is working fine but today it will produce the following error 到现在为止一切正常,但今天会产生以下错误 在此处输入图片说明

it is working fine when I test to the local server but when I uploaded to 000webhost server it will produce an error 当我测试到本地服务器时,它工作正常,但是当我上传到000webhost服务器时,它将产生一个错误

Variable 'sql_mode' can't be set to the value of 'REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( @@sql_mode' SELECT vValue FROM configurations WHERE eStatus = 'Active' AND vName = > 'PAGE_DATA_LIMIT' ORDER BY iSettingId DESC 变量'的sql_mode'不能被设置为'的值REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(@@的sql_mode' SELECT vValue FROM configurations WHERE eStatus = '有效' AND vName => 'PAGE_DATA_LIMIT' ORDER BY iSettingId数据中心

At Filename: core/MY_Model.php all code is working fine there is no error on Line Number: 94 which is displayed Filename: core/MY_Model.php所有代码都可以正常工作,在显示的Line Number: 94上没有错误

打开文件config / database.php并将值的变量stricton更改为“ TRUE”

'stricton' => TRUE,

No idea why this throws. 不知道为什么会这样。 But you can temporarily bypass it by setting sql_mode to null 但是您可以通过将sql_mode设置为null来暂时绕过它

$this->db->query("SET sql_mode = '' ");
//rest of your DB codes

before you import sql file to database(mysql) 在将sql文件导入数据库之前(mysql)

change line 换线

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

to be 成为

SET SQL_MODE = "";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM