[eluser]ppwalks[/eluser]
Hi all,
I need a bit of assistance, I have a foreach loop iterating through an array which is grouped by a field called level, what I need to do is add a h2 tag above each set of grouped results can anyone help with this please.
Here is my sql
Code:
$sql = "SELECT `id`, `title`, `level` from `toplevels` GROUP BY level, title ORDER BY id ASC";
and my array is as follows
Code:
Array ( [0] => Array ( [id] => 1 [title] => Why Sewell [level] => 1 ) [1] => Array ( [id] => 2 [title] => About Sewell [level] => 1 ) [2] => Array ( [id] => 3 [title] => Services [level] => 1 ) [3] => Array ( [id] => 4 [title] => Careers [level] => 1 ) [4] => Array ( [id] => 5 [title] => Giving Back [level] => 1 ) [5] => Array ( [id] => 7 [title] => Paul's about us page 6 [level] => 2 ) [6] => Array ( [id] => 8 [title] => Hi all, another url problem [level] => 2 ) [7] => Array ( [id] => 9 [title] => a test [level] => 2 ) [8] => Array ( [id] => 14 [title] => Kierans About us page [level] => 2 ) [9] => Array ( [id] => 15 [title] => Article 1b [level] => 3 ) )
I need all the data with level 1 in one group and with a header and so on for each level assigned.
Thanks in advance Paul