开发者

Syntax error when doing an update to modify multiple fields using mysql

开发者 https://www.devze.com 2023-03-31 18:58 出处:网络
开发者_如何学PythonCan I modify the mysql syntax SET more of a sample script: UPDATE login SET id=\'21\' AND ip=\'789\' WHERE nama=\'ariel\'
开发者_如何学Python

Can I modify the mysql syntax SET more of a sample script:

UPDATE login SET id='21' AND ip='789' WHERE nama='ariel'

Please corrected if I am wrong.


And should be ,

UPDATE login SET id='21', ip='789' WHERE nama='ariel'


I don't think you should use AND like that. Instead I think it should be something more like a list like this:

UPDATE login SET id='21',ip='789' WHERE nama='ariel'

AND is typically used as part of a WHERE clause, not in the list of fields to be updated.

0

精彩评论

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