I have a table like this:
| ID | id_foreign | cosa |
-------------------------------
| 1 | 1 | cosa1 |
| 2 | 1 | cosa2 |
| 3 | 2 | cosa1 |
| 4 | 3 | cosa1 |
| 5 | 4 | cosa1 |
| 6 | 4 | cosa2 |
| 7 | 4 | cosa3 |
| 8 | 4 | cosa4 |
-------------------------------
What I want is Show with php and html a table where I get, for example:
| id_foreign | cosas |
------------------------------
| 1 | · cosa1 |
| | · cosa2 |
------------------------------
| 2 | · cosa1 |
------------------------------
| 3 | · cosa1 |
------------------------------
| 4 | · cosa1 |
| | · cosa2 |
| | · cosa3 |
| | · cosa4 |
------------------------------
How should the consulate do to obtain that result?
Or rather it has to be done with sql or can it be done with php?
Thanks