Ok, so I really have 2 questions and was wondering if anyone could shed some light one them. Firstly... I have table like this:
|id|name|date|activtiy|
|1|Jo Bloggs|1238411497|went to the Circus|
|2|Fred Kent|1238411497|went to School|
|3|Jane Bloggs|1238411596|went Sailing|
|4|Mike Smith|1238411596|broke his leg|
And I want to format my results like this:
1238411497
Jo Bloggs went to the Circus.
Fred Kent went to School.
1238411596
Jane Bloggs went Sailing.
Mike Smith broke his leg.
I've looked into foreach loops and in all honesty, the confuse me a little and I wonder if they are event appropriate (I assumed by the name that they would be). What would be the best way to go about doing this?
Second question would is; I have a table like this:
|name|pie|cake|bread|eggs|butter|cheese|pancakes|
|Jo Bloggs|0|1|0|0|0|1|0|
|Mike Smith|1|1|1|1|0|1|0|
And I'd like to create a list which echos the things a person likes... so:
Jo Bloggs
|cake(dropdown)|
|eggs|
Mike Smith
|pie(dropdown)|
|cake|
|bread|
|eggs|
|cheese|
Again, what would be the best way to do this? I don't really know where to start on thsi one. I know you can select column names, but how do you select column names based on their data being 1 or 0. Any help greatly appreciated.