I'm currently trying to make a loop that creates arrays, but I need to set the name of the array dynamic, so that all arrays have a name like $array0, $array1.
I am fetching rows from a MySQL table that all have an ID, that ID is stored in $rowData[0], so I want make arrays that have a name with this ID.
I currently have this:
if(mysql_num_rows($result)!=0) {
while($rowData = mysql_fetch_array($result)) {
echo '<pre>';-
$array . $rowData[0] = new ArrayObject($rowData);
print_r($array . $rowData[0]);
echo "<h1>" . $array . $rowData[0] . [1] . "<h1>";
echo '</pre>';
}
}
Thanks in advance.
mysql_functions are deprecated and have been removed in PHP 7. Usemysqli_orPDOfunctions instead.