Search
 
SCRIPT & CODE EXAMPLE
 

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); 
Comment

PREVIOUS NEXT
Code Example
Php :: string to array php 
Php :: 1 to many relationship in laravel 
Php :: PHP - Elegant way of removing values from Associative Arrays based on a key value duplication 
Php :: laravel allow all fillable 
Php :: php ini_set 
Php :: php infinite loop 
Php :: View [layouts.master] not found 
Php :: send mail infinityfree phpmailer 
Php :: laravel get unique data by column and order by 
Php :: php rand between 0 and 1 
Php :: laravel override eloquent all function 
Php :: link title to blog post wordpress in the loop 
Php :: check url parameter if not redirect wordpress plugin 
Php :: Laravel unique with Validation with multiple input value 
Php :: how to prevent the Undefined index in php 
Php :: update php 
Php :: artisan app name 
Php :: laravel 8 search with pagination 
Php :: How do I ge the version of wordpress? 
Php :: php file hash 
Php :: Laravel Extract Values From Collection Using Pluck() with Relationship 
Php :: laravel get url parameters in controller 
Php :: update to php 7.4 
Php :: What is the name of scripting engine in PHP? 
Php :: post rest drupal 
Php :: laravel api error return homepage 
Php :: php break and continue 
Php :: creating jobs laravel 
Php :: magento Fatal error: Allowed memory size of 134217728 bytes exhausted 
Php :: laravel 8 jwt api authentication 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =