所以我的问题是我想选择等级1和2
$getCredits = mysql_query("SELECT `look`,`username`,`activity_points` FROM `users` WHERE `rank` = '0' ORDER BY `activity_points` DESC LIMIT 10");
最佳答案
尝试这个:
$getCredits = mysql_query("SELECT `look`,`username`,`activity_points` FROM `users` WHERE `rank` = '1' OR `rank` = '2' ORDER BY `activity_points` DESC LIMIT 10");
使用SQL OR运算符
more about SQL Operators
关于php - MySQL从2个以上级别中选择,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41960198/