I created a webapp using Laravel and SQLite, everything is fine. Now I want to use MySQL as a database, but now I can not add data to my tables.
This is the field from my migration:
$table->dateTime('last_updated')->nullable();
and this is how I fill the field using laravel:
$client->last_updated = time();
But this gives me an error, for example:
Illuminate \ Database \ QueryException
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '1402140378' for column 'last_updated' at row 1 (SQL: update `clients` set `last_updated` = 1402140378 where `id` = 1)
Any help would be appreciated.
source
share