Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sql1 = "SET @rownum := 0";
- $sql2 = "SELECT rank, Score FROM (
- SELECT @rownum := @rownum + 1 AS rank, Score, Username
- FROM `Users` ORDER BY Score DESC
- ) as result WHERE Username='".$_SESSION['Username']."'";
- mysql_query($sql1);
- $result = mysql_query($sql2);
- $rows = "";
- $data = array();
- if (!empty($result))
- $rows = mysql_num_rows($result);
- else
- $rows = "";
- if (!empty($rows)){
- while ($rows = mysql_fetch_assoc($result)){
- $data[] = $rows;
- }
- }
Add Comment
Please, Sign In to add comment