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
attendancesset00: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
![[Image]](https://i.sstatic.net/Nymj7.png)
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']]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With