Laravel runs in MySQL5.1 with the following error: {code ...} but there is no problem with executing the test on the PDO written by myself. {code ...} data table structure: it was also found on the Internet that the SQL _MODE has been changed, and the error is still reported. The problem is solved by adding Shell filter...
Laravel runs in MySQL5.1 with the following error:
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ''1'' for column 'status' at row 1 (SQL: insert into `cases` (`case_name`, `status`, `updated_at`, `created_at`) values ('fdsafdsadsa', '1', 1474504956, 1474504956))
But there is no problem with executing the test on the PDO written by myself.
Try {$…… = $ db-> prepare ('Insert into cases (case_name, status, updated_at, created_at) values (?,?,?,?) '); $ Something-> bindValue (1, '', PDO: PARAM_STR); $ Something-> bindValue (2, '1', PDO :: PARAM_INT); $……-> bindValue (3, time (), PDO: PARAM_INT); $……-> bindValue (4, time (), PDO: PARAM_INT ); $ Something-> execute ();} catch (\ Exception $ e) {echo $ e-> getMessage ();}
Data table structure:
I also checked it online and said that the SQL _MODE has been changed, and an error is still returned.
The problem has been solved due to the double quotation marks caused by Shell filtering.
Reply content:
Laravel runs in MySQL5.1 with the following error:
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ''1'' for column 'status' at row 1 (SQL: insert into `cases` (`case_name`, `status`, `updated_at`, `created_at`) values ('fdsafdsadsa', '1', 1474504956, 1474504956))
But there is no problem with executing the test on the PDO written by myself.
Try {$…… = $ db-> prepare ('Insert into cases (case_name, status, updated_at, created_at) values (?,?,?,?) '); $ Something-> bindValue (1, '', PDO: PARAM_STR); $ Something-> bindValue (2, '1', PDO :: PARAM_INT); $……-> bindValue (3, time (), PDO: PARAM_INT); $……-> bindValue (4, time (), PDO: PARAM_INT ); $ Something-> execute ();} catch (\ Exception $ e) {echo $ e-> getMessage ();}
Data table structure:
I also checked it online and said that the SQL _MODE has been changed, and an error is still returned.
The problem has been solved due to the double quotation marks caused by Shell filtering.