I am attempting to combine two rows into a single column on mysql this is getting all two players in 1 single query and combine them using the team column, my table is below.
+-------------------+
| ID player Team |
+-------------------+
| 1 John Doe Team1 |
| 2 Anna Doe Team1 |
+-------------------+
What I want to achieve is below.
+-----------------------------+
| ID player1 player2 Team |
+-----------------------------+
| 1 John Doe Anna Doe Team1 |
+-----------------------------+
I am using PHP as my backend and doing a loop and pushing into a single array can do the job but I believe it can be attained using mysql query. any suggestion would be great.