Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mick79's avatar

What's wrong with this query?

Here is my query

 Model::where('artist_token', $token)
            ->update([
                ['artist_token' => "000"],
                ['account_token' => "000"]
            ]
        );

And here is the error

SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'field list' (SQL: update `models` set `0` = {"artist_token":"000"}, `1` = {"account_token":"000"}, 

This query should update "artist_token" and "account_token" to "000" according to the docs.

0 likes
2 replies
MichalOravec's avatar
Level 75

Can you see the difference?

Model::where('artist_token', $token)->update([
    'artist_token' => '000',
    'account_token' => '000'
]);
1 like

Please or to participate in this conversation.