Reputation: 53
As i update column with null value, it gives me an error like this:
SQLSTATE[42S22]: Column not found: 1054 Unknown column '00:00:00' in 'field list' (SQL: update
attendances
set00:00:00
= 12:11:45 where (studentid
= 4 anddate
= 2018-07-09))
query
DB::table('attendances')
->where(['studentid' => $singleData['id'], 'date' => $date])
->update([$data['out_am'] => $time]);
my controller
Upvotes: 4
Views: 3226
Reputation: 18187
You are using a value as a field name. It should probably be something like this:
DB::table('attendances')
->where(['studentid' => $singleData['id'], 'date' => $date])
->update(['out_am' => $data['out_am']]);
Upvotes: 3