Proper display of query result
Posted: Thu Oct 28, 2010 11:57 am
Hi all...
I have a mysql query that pulls the name of bar from a database and then all associated daily specials for that bar.
What I'm trying to do is have it format like this:
Bar One
special one
special two
special three
Bar Two
special one
special two
special three
My problem is that don't know how to accomplish this so that each bar name is not repeated for the number of specials they have. (i.e. Bar one has 3 specials so right now my php is displaying that bar name three times.
The output data should be placed in it's own appropriate span class like this:
Bar title will be placed in <span class="title">Bar Title</span>
Each special will be listed on a line of it's one in <span class="special">Bar Special</span>
I've attached a quick mockup sample of what the finished list should look like.
I know this is fairly simple but I can't seem to be able to get this.
Any help would be greatly appreciated
Thanks
I have a mysql query that pulls the name of bar from a database and then all associated daily specials for that bar.
What I'm trying to do is have it format like this:
Bar One
special one
special two
special three
Bar Two
special one
special two
special three
My problem is that don't know how to accomplish this so that each bar name is not repeated for the number of specials they have. (i.e. Bar one has 3 specials so right now my php is displaying that bar name three times.
The output data should be placed in it's own appropriate span class like this:
Bar title will be placed in <span class="title">Bar Title</span>
Each special will be listed on a line of it's one in <span class="special">Bar Special</span>
I've attached a quick mockup sample of what the finished list should look like.
I know this is fairly simple but I can't seem to be able to get this.
Any help would be greatly appreciated
Thanks