Jonesy44 commented on a Page, PHP Slots game  -  Apr 23, 2008

hmmkay. also. i\'ve added an sql db to record scores;

function slotsScores() {
  $pos = 1;
  $ip = ($_SERVER[\'HTTP_X_FORWARDED_FOR\'])
      ?  $_SERVER[\'HTTP_X_FORWARDED_FOR\']
      :  $_SERVER[\'REMOTE_ADDR\'];
  $sql = mysql_query(\"SELECT * FROM `slots` ORDER BY `cash` DESC\");
  while ($c = mysql_fetch_array($sql)) {
    if ($c[\"ip\"] == $ip) {
      echo \'<b>@ \';
    }
    echo $pos. \' - $\' .$c[\"cash\"]. \'</b><br>\';
    $pos = $pos + 1;
  }
}

however;

Top Scores;

1 - $8100
2 - $4750
3 - $300
@ 4 - $10800

it orders correctly, apart from my score :s

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.