DEV Community

loading...

Why I am unable to perform this update using laravel query builder?

pcmagas profile image Dimitrios Desyllas ・1 min read

I run the following code:

$crm_code = "Omaewamoshindeiru"
DB::update("UPDATE death_invitation set active = false where crm_code = '?' and active = true and contract_type_id IN (13, 14, 20, 21)",[[$crm_code]]);

And I recieve the following error:

Illuminate/Database/QueryException with message 'PHP Notice:  Array to string conversion in /var/www/html/api/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 575 (SQL:

Discussion

pic
Editor guide