LukyVj
LukyVj

Reputation: 1491

UPDATE sql tables issues

i have some issues with this sql

UPDATE `rate` FROM `dv_post` SET `rate`=1 WHERE `id` = 9 

The response :

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'FROM dv_post SET rate=1 WHERE id = 9' at line 2'

Upvotes: 0

Views: 63

Answers (2)

Jarod Elliott
Jarod Elliott

Reputation: 15670

The syntax of your update query is incorrect and shouldn't include the FROM.

Try this:

UPDATE `dv_post` SET `rate`=1 WHERE `id` = 9 

Upvotes: 1

John Conde
John Conde

Reputation: 219804

Update statements don't have a FROM clause

UPDATE `dv_post` SET `rate`=1 WHERE `id` = 9 

Upvotes: 3

Related Questions