操作数应包含1列UPDATE

时间:2012-07-14 03:07:41

标签: php mysql mysql-error-1241

我应该使用哪些sql语句来做这样的事情?

UPDATE 
`table1`
SET
`media` = 'url'
WHERE
`media` = '3' AND `forum_post_id` = ('109918','109949','109882','109819','109822')

现在我得到的操作数应该包含1列错误

1 个答案:

答案 0 :(得分:2)

使用“IN”:

UPDATE `table1`
SET `media` = 'url'
WHERE`media` = '3' AND `forum_post_id` IN ('109918','109949','109882','109819','109822')

Documentation for "IN"