Forum Moderators: coopster
Right now, my code will output five records onto the screen. What I would like instead would be to output this content into one array.
How might I do that?
Thanks
$query=mysql_query("SELECT content FROM database LIMIT 5");
while($row=mysql_fetch_array($query)) echo $row["content"];
I have observed that using this syntax:
$array[] = $row['content'];
is about twice as fast (on average) than using this:
array_push($array,$row["content"]);
when dealing with large arrays. :)