Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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); 
 
PREVIOUS NEXT
Tagged: #invalid #datetime #incorrect #string
ADD COMMENT
Topic
Name
1+7 =