0
Good afternoon,
I have a table that receives data from a mysql that works correctly. But it does not return the corresponding value of a column all within one , Example:
How does it look:
PROFESSOR | ALUNOS
CARLOS | LUIZ
CARLOS | CAIO
CARLOS | matheus
CARLOS | ROBERTO
JOSE | RODRIGO
JOSE | LEANDRO
JOSE | WAGNER
JOSE | LUIZ
ELDER | LUIZ
ELDER | EDUARDO
ELDER | VICTOR
ELDER | RODRIGO
How I’d like you to stay
PROFESSOR | ALUNOS
CARLOS | LUIZ,caio,matheus,roberto
JOSE | RODRIGO,LEANDRO,WAGNER,LUIZ
ELDER | LUIZ,EDUARDO,VICTOR,RODRIGO
My code
<table class="table table-striped table-bordered table-hover table-filters">
<thead>
<tr>
<th>Professor</th>
<th>Aluno</th>
</tr>
</thead>
<tbody>'
foreach($analises as $key => $cada){
<tr>
<td><?php echo $cada->['professor']; ?></td>
<td><?php echo $cada->['aluno']; ?></td>
</tr>;
}
</tbody>
</table>
post the query being made.
– Lucas Brogni
I’ll tell you right away that you need to know the function
GROUP_CONCAT
to find the answer you want. But as Lucas has already said, you haven’t posted the most important of your question, your query.– fernandosavio