Guest User

Untitled

a guest
Aug 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1.         $sql1 = "SET @rownum := 0";
  2.         $sql2 =   "SELECT rank, Score FROM (
  3.                        SELECT @rownum := @rownum + 1 AS rank, Score, Username
  4.                        FROM `Users` ORDER BY Score DESC
  5.                        ) as result WHERE Username='".$_SESSION['Username']."'";
  6.  
  7.         mysql_query($sql1);
  8.         $result = mysql_query($sql2);
  9.         $rows = "";
  10.         $data = array();
  11.         if (!empty($result))
  12.             $rows = mysql_num_rows($result);
  13.         else
  14.             $rows = "";
  15.  
  16.         if (!empty($rows)){
  17.             while ($rows = mysql_fetch_assoc($result)){
  18.                 $data[] = $rows;
  19.             }
  20.         }
Add Comment
Please, Sign In to add comment