I have a MySQL query which returns a set or rows to me,
PersonID | ClassID | ...
As I loop through each row, I'm echoing data into a table. So far it's 101.
The issue I now have is some PersonID's are duplicated (for good reason) but they are grouped together. Table structure change is not an option.
What I want to do is combine all my PersonID's which match together as I echo them. There will likely only be 1 row each, some have 2, 3 or more is possible but unlikely.
Any ideas how I could manipulate this in PHP?
I'm thinking saving all my current row into a variable. On the next row if it matches add to it, if not echo it and replace the variable the new current row?
Thoughts?