I'm trying to update the hours_worked column in daiy_attendance table using in_time and out_time in same table. in_time and out_time already stored in the table.
So I'm using timediff to get the difference. Query runs and execute correctly when I try it on the phpmyadmin sql format, but when I try to run it in the program it does not update the hours_worked column. It does not gives any errors.
$sql5 = "UPDATE daily_attendances SET hours_worked = TIMEDIFF(out_time,in_time) WHERE in_time != '' AND out_time != '' ";
$result2 = DB::statement(DB::raw($sql5));
$fillableattributes are irrelevant.try.. catch()block and see if there is any error..