mysql_query("UPDATE `users` SET `balance` = 0 WHERE `username` = '$uid' AND '$ip'");
如何更新用户名等于UID的数据库,或者用户名是否等于$ ip?
感谢。
答案 0 :(得分:0)
几乎就像你用英语说的那样;)
mysql_query("UPDATE `users` SET `balance` = 0 WHERE `username` = '$uid' or `username` = '$ip'");
答案 1 :(得分:0)
一种方法:
UPDATE `users`
SET `balance` = 0
WHERE `username` IN ('$uid','$ip')
相当于
UPDATE `users`
SET `balance` = 0
WHERE `username` = '$uid'
OR `username` = '$ip'