i wanna update my data using array, but its error 'cause im using "like" query while finding the data. This is the code.
$pin = 10590;
$datetime = "2017-08-29 15:05:00";
$date = explode(' ', $datetime);
Attendance::where('user_id', $pin)->where('datetime_in', 'like', '%' . $date[0] . '%')->update([
'datetime_out' => $datetime,
'updated_at' => date('Y-m-d')
]);
any solutions ?? Thanks.
Incorrect datetime value: '%2017-08-29%' for column 'datetime_in'UPDATE attendance SET datetime_out="2017-08-29 15:06:00" WHERE user_id = 201037917001 AND datetime_in = "2017-08-29";Attendance::where('user_id', $pin)->where('datetime_in', '=', $date[0])->update([ 'datetime_out' => $datetime, 'updated_at' => date('Y-m-d') ]);