Answers for "invalid datetime format: 1366 incorrect string value"

PHP
0

invalid datetime format: 1366 incorrect string value

//I solved it, encoding to uft-8 all string columns that generated this error before insert.
//For example, the column that generated the error was column-name, I encoded as 
//show bellow. Also I found other column with the same error, I used this solution, too.

$data [
//key=>values 
];

$myModel = new MyModel(); 

$data['column-name'] = DB::connection()->getPdo()->quote(utf8_encode($data['column-name']));

$myModel->insert($data);
Posted by: Guest on February-25-2022

Code answers related to "invalid datetime format: 1366 incorrect string value"

Browse Popular Code Answers by Language