AndyB
Well-known member
I would like o change the following query:
to a XenForo query
but I get the following error message:
![205074 205074](https://xenforo.com/community/data/attachments/204/204940-55ab84816a4d110a009b566f3d17aed7.jpg)
What is the correct syntax?
Thank you.
PHP:
$db->query("
UPDATE xf_user
SET message_count = message_count + 1
WHERE user_id = ?
", $newUserId);
to a XenForo query
PHP:
$db->update('xf_user',
['message_count' => message_count - 1],
'user_id = ?
AND message_count > ?',
[$oldUserId, 0]
);
but I get the following error message:
![205074 205074](https://xenforo.com/community/data/attachments/204/204940-55ab84816a4d110a009b566f3d17aed7.jpg)
What is the correct syntax?
Thank you.