Variable 'sql_mode' can't be set to the value of 'REPLACE
Solution 1
Open file config/database.php and change value's variable stricton to be 'TRUE'
'stricton' => TRUE,
Solution 2
No idea why this throws. But you can temporarily bypass it by setting sql_mode
to null
$this->db->query("SET sql_mode = '' ");
//rest of your DB codes
Solution 3
before you import sql file to database(mysql)
change line
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
to be
SET SQL_MODE = "";
TarangP
Available for solving your PHP / Django Problems. Mail @ [email protected].
Updated on July 28, 2022Comments
-
TarangP over 1 year
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
Variable 'sql_mode' can't be set to the value of 'REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( @@sql_mode' SELECT
vValue
FROMconfigurations
WHEREeStatus
= 'Active' ANDvName
= > 'PAGE_DATA_LIMIT' ORDER BYiSettingId
DESCAt
Filename: core/MY_Model.php
all code is working fine there is no error onLine Number: 94
which is displayed -
TarangP over 4 yearsCan you please explain what it changes & what is the usage. Thanks.
-
Dariswan Janweri P. over 4 yearsso, TRUE/FALSE (boolean) - Whether to force “Strict Mode” connections, good for ensuring strict SQL while developing an application. sorry i didnt give any information, i just read documentation's code igniter : codeigniter.com/user_guide/database/configuration.html