Hi all
I need to add values received from MySQL into an array [PHP], here is what I've got:
$players = array();
while ($homePlayerRow = mysql_fetch_array($homePlayerResult)) {
$players[] = $homePlayerRow['player_id'];
}
Is this the only way of doing it? Also, is the following faster/better?
$players = array();
while ($homePlayerRow = mysql_fetch_array($homePlayerResult)) {
array_push($players, $homePlayerRow['player_id']);
}
Thanks in advance