MySQL and PHP - For Each?

Posted by topdog 590 days ago Questions| content php mysql All

Hi all,

I have following code:

SELECT q21, q21coding  AS Description FROM `tresults_acme` WHERE q21 IS NOT NULL AND q21 <> '' ORDER BY q21coding

It brings back the following (excerpt):

Text                                                     Description
Lack of up to date equal pay cases&legislation - t... Content needs updating
The intranet could contain more "up to date traini... Content needs updating
Poorly set out. It is hard to find things.            Difficulty in navigating/finding content
Only use the intranet as a necessity. Will ask my ... Difficulty in navigating/finding content

Now, I'd like to display this in a table on a PHP page but am having some problems because of the way I'd like it displayed, it needs to be as follows:

Content needs updating
----------------------
[List all the comments relating to this description]

Difficulty in navigating/finding content
----------------------------------------
[List all the comments relating to this description]

and so on.

Now I think it is a For Each loop in PHP but I am having terrible difficulty getting my head around this - any ideas and suggestions very very welcome!

Thanks,

Originally asked by: Homer_J on Stack Overflow

Discuss Bury


Who Voted for this Question