lundi 31 juillet 2017

DB update query in Laravel?

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 im 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 programme it does not update the 'hours_worked' column.it does not gives any errors also.

$sql5 = "UPDATE daily_attendances SET hours_worked = TIMEDIFF(out_time,in_time) WHERE in_time != '' AND out_time != '' ";
$result2 = DB::statement(DB::raw($sql5));



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire