RASEL RANA
RASEL RANA

Reputation: 2190

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'adjusted_amount' in 'field list'

I have tried lot's of times and debugged but till now i can't find out where is the problem? Any kinds of help appreciated.

Error:

QueryException in Connection.php line 662: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'adjusted_amount' in 'field list' (SQL: update tbl_bill_collection set dueamount = 0, adjusted_amount = 100, adjusted_by = 5302, adjusted_date = 2016-12-20 21:19:31 where billno = 7777)

In My Controller Code:

        DB::table( 'bill_collection' )
        ->where( 'billno', 555 )
        ->update([
            'dueamount'     => $request->input( 'dueamount' ),
            'adjusted_amount' => $request->input( 'adjustment' ),
            'adjusted_by'   => Auth::User()->id,
            'adjusted_date' => date('Y-m-d H:i:s'),
        ]);

My database table column images given below:

enter image description here

Upvotes: 0

Views: 3062

Answers (1)

diabetesjones
diabetesjones

Reputation: 838

There are most likely invisible characters being the problem, like here: "Unknown column in 'field list'", but column does exist

Re-type the query by hand and see if that helps.

Upvotes: 0

Related Questions