I have a table that looks like:
Client_ID | Order_ID |
10 | 1 |
10 | 2 |
10 | 3 |
14 | 6 |
14 | 7 |
14 | 9 |
Is there an elegant way in PHP of printing out this result set putting in evidence the client_id groups instead of making a loop that remembers the previous Client_ID and verifies if it changed.
Client 10:
- Order 1
- Order 2
- Order 3
Client 14:
- Order 6
- Order 7
- Order 9