What I would like to do is the following:
I have an SQL query that give's me an output. On that output 1 make an selection in php.
$cities[$row['stad']][$row['status']]++
This gives me an output like this (within a <pre> tag ):
Array
(
[Amsterdam] => Array
(
[41] => 2
[21] => 91
[43] => 16
[42] => 2
[20] => 30
[4] => 4
[70] => 3
[84] => 8
[46] => 4
[45] => 5
[999] => 26
[47] => 2
[3] => 8
[44] => 1
[40] => 1
[93] => 5
[56] => 3
[61] => 3
[79] => 3
[48] => 2
[50] => 5
[10] => 10
[52] => 2
[120] => 1
[95] => 1
[1] => 65
[90] => 6
)
I would like to put in an html table like so :
City 41 21 43 42 20 7 …… etc
amsterdam 2 91 16 2 30 4 …… etc
important to know is there are more than 1 city.
This is what I have at the moment :
echo '<table cellpadding="10" cellspacing="10" border="1">';
foreach($cities as $city) {
echo '<tr>';
echo '<td>' . $row['stad'] . '</td>';
echo '<td>' . $city[$row['status']] . '</td>';
echo '</tr>';
}
echo '</table>';