In my PHP application, I need to take a multidimensional array and extract values in a for loop. The query will always return 9 rows.
$w = mysqli_query($con,"SELECT age, percent FROM drive03_2_monthly_income WHERE birthYear='1956' AND (age LIKE '%.00%') ORDER BY birthYear,age ");
$row = mysqli_fetch_array($w);
for($n=0;$n<9;$n++) {
echo $row[$n]->age." -- ".$row[$n]->percent."<br />";
}
When I run this, I get the data I want in $w, but having a problem extracting values in the loop.
here you are.