Codeigniter view file looping query
- by user2505513
Right, I'm unsure about how to code my view file to generate following query results WITHOUT compromising the principles of mvc.
Query in model:
SELECT * FROM events GROUP BY country, area ORDER BY country, area
View:
<?php if (isset($query)):?>
<?php foreach ($query as $row):?>
<h2><?=$row->country?></h2>…