15.05.2016, 20:13
How can I loop through my database with MySQL?
Lets say, I want to check if all players in the database their Org == 1?
Lets say, I want to check if all players in the database their Org == 1?
SELECT ((SELECT COUNT(*) FROM Player WHERE Org=1) = (SELECT COUNT(*) FROM Player)) AS ret
// After you send the query, fetch the value of "ret".
"SELECT IF(COUNT(*) = SUM(CASE WHEN Org=1 THEN 1 ELSE 0 END),1,0) FROM Player"
SELECT * FROM `table` WHERE `Org` = '1'
mysql_next_row