I have a query that returns data like this:
+-----------+---------------+---------------+--------------+
| recipe_id | name | ingredient_id | item |
+-----------+---------------+---------------+--------------+
| 1 | Apple Crumble | 1 | apple |
| 1 | Apple Crumble | 5 | flour |
| 1 | Apple Crumble | 7 | butter |
| 1 | Apple Crumble | 8 | sugar |
| 2 | Fruit Salad | 6 | fruit juice |
| 2 | Fruit Salad | 2 | banana |
| 2 | Fruit Salad | 1 | apple |
| 2 | Fruit Salad | 3 | kiwi fruit |
| 2 | Fruit Salad | 4 | strawberries |
+-----------+---------------+---------------+--------------+
How do i loop through and remove the duplicate records but keep the items for each? so something like this:
1 Apple crumble 1 apple, 5 flour, ... .. ..
Aucun commentaire:
Enregistrer un commentaire