how to not show rank if dosn't exist in database id in database
SQL code:
$query = "SELECT id, points, count(*)+1 AS rank FROM weekly_points
WHERE points > (SELECT points FROM weekly_points
WHERE id='".$account['id']."'
)";
Example query for id 15000 which doesn't exist:
SELECT id,points,count(*)+1 as rank
FROM weekly_points
WHERE points > (SELECT points FROM weekly_points WHERE id='15000')
-- output is rank 1 which is wrong
For id doesn't exist it shows rank 1 but I want to not show the rank or to be 9999999 or last place
Sample,for rank to show
uid------points-----> rank
1----------100-----5
2----------200------4
3----------1000---- 1
4----------300-----3
5----------400-----2