PHP question - Database values are always zero...
I'm posting this on behalf of MarkP, who is having trouble accessing Flashkit.
PHP Code:
<?php
$server = "localhost";
$username = "me";
$database = "db";
$table = "tutorial_user_auth";
$password = "pass";
print "High Score<BR>";
mysql_connect($server,$username,$password);
@mysql_select_db($database) or die( "Unable to select database ");
$query="SELECT * FROM $table ORDER BY HighScore DESC";
//$result=mysql_query($query);
$result=mysql_query($query) or die( "query failed");
$i = 0;
while ($i < 10)
{
$username = mysql_result($result,$i,"userName");
$highscore = mysql_result($result,$i,"HighScore");
print ("<b>" . $username . "</b> Score: " . $highscore . "<BR>");
++$i;
}
?>
This seems to work, but the score values (HighScore) are always returned as 0 (zero). The names are got from the database correctly... but the scores are always zero!!!!
Its getting the names and ordering them by their userID, the key field in the database.
Is this because I added the scores in to the database manually?
It shouldn't be, should it?