开发者

Format for adding a second update to a query

For the query below, I would like to add the following action: update a column called "flag1" to be equal to a variable call开发者_JAVA技巧ed $uflag. What is the correct format for that?

UPDATE submission SET votes_up = $votes_up WHERE submissionid = $id


Just like manual says

UPDATE 
  submission 
SET 
  votes_up = $votes_up, 
  flag1 = $uflag 
WHERE 
  submissionid = $id

http://dev.mysql.com/doc/refman/5.1/en/update.html


UPDATE submission 
SET votes_up = $votes_up, flag1 = $uflag
WHERE submissionid = $id
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜