-1
It is the following I have a table in mysql in which it keeps the name of the students and in this same table it has a column that keeps the code of the class in which the student is enrolled, I need a query that for each class returns me the set of students that belong to her, example
1st year: - Joao, maria, Ronaldo,
2nd year: - carlos, Fabio, Marcos,
the problem is that with Inner Join she returns me the class name repeatedly and for each position of the returned array it shows me only one student.
example:
1st year - July
1st year - Mary
1st year - Ronaldo
2nd year - carlos
2nd year - Fabio
2nd year - Ronaldo
how could I make a query that returns to me as the first example above?
as you can see in the images Robert Downey JR is in the same class that Carlos appeared but he appears in another part of the array I wanted him to appear in the same section as Carlos and so the 1st year primary class appeared only once
Edit the php part of the code, remove the image and enter the code.
– Wictor Chaves
I changed the question by also adding an option separating the result with php
– Wictor Chaves