Jump to content

Whats wrong here?


jmaccs64

Recommended Posts

I am new at this....can someone please tell me what is wrong with this statement?
Thanks


[code]SELECT users.username, users.vote_count, surpool06.surpool_username, surpool06.surpool_team
FROM users
INNER JOIN surpool06
ON users.username = surpool06.surpool_username
UPDATE
users SET vote_count = IF(surpool_team = 'Bears',vote_count-1,vote_count)[/code]
Link to comment
https://forums.phpfreaks.com/topic/21483-whats-wrong-here/
Share on other sites

Provided you're using a recent version of MySQL, UPDATE statements support multiple tables (UNTESTED):
[code]
UPDATE users
INNER JOIN surpool06
ON users.username = surpool06.surpool_username
SET vote_count = IF(surpool_team = 'Bears',vote_count-1,vote_count)
[/code]
Link to comment
https://forums.phpfreaks.com/topic/21483-whats-wrong-here/#findComment-96058
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.