嗨,我正在尝试使用诸如“user1”和“score1”之类的索引填充数组以返回函数。
我的代码:它出现了无法识别的变量错误
$query = 'select * from users order by score desc';
$result = mysql_query($query) or die (mysql_error());
$highscore = array();
$count = '0';
while($row = mysql_fetch_array($result))
{
$count++;
$highscore = array('user' . $count => $row['username'], 'score' . $count => $row['score']);
}
return $highscore;