• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Group by array in CI

I am trying to generate a "past events" page for my CI website, using a MySQL database table called "events". There are 100+ rows of data, some duplicate, that range across 5 major countries - England, Ireland, Norther Ireland, Scotland and Wales - many different major cities - again, including duplicate entries - and venues.

I have struggled for a couple of weeks now with how to query and return the data in the following format:

<h1>** grouped country **</h1>
<h2> ** grouped city **</h2>
<p>** grouped venue **</p>

Such as:

<p>Tower of London</p>
<p>Canal Street</p>
<p>Old Trafford</p>
<p>St. James' Gate</p>
<p>Buchanan Street</p>
<p>Tron Theatre</p>

I am DELIBERATELY not including any of my code for model, view and controller, as what I have thus far seems to confuse people as to what I'm trying to achieve when they see it. And I'm open to the fact I may be attacking this from the wrong angle altogether... I just need to result the above!

It feels as if this SHOULD be a fairly simple thing to achieve, but I NEED HELP!

Any ideas anyone?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.