嗨即時嘗試填充索引像'user1'和'score1'返回到一個函數。從while循環填充數組返回PHP
我的代碼:它與unindentified變量錯誤
出現$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;
這不會給數組的數組? – Gareth
@gar - true true - 我的鍵盤在第二秒離開了我:P – Lix