I have a mysql table like below:
id name points 1 john 4635 3 tom 7364 4 bob 234 6 harry 9857
SET @rownum := 0; SELECT rank, score FROM ( SELECT @rownum := @rownum +1 AS rank, `score` ,`user_id` FROM leaderboard ORDER BY `score` DESC , `updated_timestamp` ) as result WHERE `user_id`=$user_id LIMIT 1