I'm busy with a table which is showing the VIP points of my users.
But I don't want the people with a higher rank than 3 on this list. This is the code I'm using now but this is also showing people above the 3rd rank:
<?php
$count = 1;
$users_a = mysql_query("SELECT * FROM users ORDER BY vip_points DESC LIMIT 7");
while ($users = mysql_fetch_assoc($users_a)) {
$row = mysql_fetch_assoc($row = mysql_query("SELECT * FROM users WHERE id = '" . $users['id'] . "' LIMIT 10"));
?>
Does anyone know what I'm doing wrong? Or how I can fix this?
Thanks alot!
SELECT * FROM users
GROUP BY `vip_points` having vip_points>3
ORDER BY vip_points DESC LIMIT 7