How do I create an array of all the results from my mysql query using mysql_fetch_array()? This code is close, but produces severe data duplication. Am I on the right track?
while ($result2[] = mysql_fetch_array($result)) {
}
How do I create an array of all the results from my mysql query using mysql_fetch_array()? This code is close, but produces severe data duplication. Am I on the right track?
while ($result2[] = mysql_fetch_array($result)) {
}
Got it.
while ($result2 = mysql_fetch_array($result)) {
$result3[] = $result2;
//echo '<br/>';
}
Actually - since you really should be moving away from the MySQL_*** functions/interface, you could be using PDO and the FetchAll function to do this.