Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel更新数据库错误_Php_Mysql_Laravel_Eloquent - Fatal编程技术网

Php Laravel更新数据库错误

Php Laravel更新数据库错误,php,mysql,laravel,eloquent,Php,Mysql,Laravel,Eloquent,我正在尝试更新一个表。我收到了这个错误 Next Illuminate\Database\QueryException: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'B2AFE7CB-3451-4C73-9948-C3DD2B21F949' (SQL: update `match_histories` set `format_type` = 0, `user_score` =

我正在尝试更新一个表。我收到了这个错误

Next Illuminate\Database\QueryException: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'B2AFE7CB-3451-4C73-9948-C3DD2B21F949' (SQL: update `match_histories` set `format_type` = 0, `user_score` = 2, `opponent_score` = 0, `ended_at` = 2017-05-08 02:07:39, `opponent_ign` = poudigne, `user_champion` = Kagulichu, `opponent_champion` = Uzzu the Bonewalker where `match_id` = 35339) in /home/vagrant/hexstatstracker/vendor/laravel/framework/src/Illuminate/Database/Connection.php:647
我要更新的代码:

$udt_arr = array(
   'format_type' => $tour_data['Format'],
   'user_score'=> $myScore,
   'opponent_score'=> $oppScore,
   'ended_at' => date('Y-m-d H:i:s'),
   'opponent_ign' => $oppName,
   'user_champion' => $ongoing_match->user_champion,
   'opponent_champion' => $ongoing_match->opponent_champion,
);

DB::table('match_histories')
    ->where('match_id', $match_id)
    ->update($udt_arr);

列中可能已经有无效数据,这将阻止查询正确执行。列中的
结束\u必须具有数据类型
时间戳
。您检查过了吗?请在此处打印您的
$udt\u arr
数组,以便通过将我的ID切换为自动增量而不是GUID来检查sameFixed的所有值。由于一个未知的原因,PHP似乎将GUID转换为Double。您的列中可能已经有无效数据,这将阻止查询正确执行。您的
列结束\u必须具有数据类型
时间戳
。您检查过了吗?请在此处打印您的
$udt\u arr
数组,以便通过将我的ID切换为自动增量而不是GUID来检查sameFixed的所有值。出于一个未知的原因,PHP似乎将GUID转换为双精度