I'm having trouble grouping schedules by date.
I have a table in html that is populated from an sql query. The idea would be to list in a column the date and in the other column all the schedules referring to that date without having to jump line like in the photo that I posted at the end. What could be done?
Code:
<table class="table table-striped">
<thead>
<tr>
<th>Data</th>
<th>Marcações</th>
</tr>
</thead>
<?php
$con = mysql_connect($host, $user, $pass) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($db, $con);
$sql= mysql_query("SELECT dia, hora FROM marcacoes");
while($exibe = mysql_fetch_assoc($sql)){
$tabela ='<tbody>';
$tabela .='<tr>';
$tabela .='<td>'.date("d-m-Y", strtotime($exibe['dia'])).'</td>';
$tabela .='<td>'.$exibe['hora'].'</td>';
$tabela .='</tr>';
$tabela .='</tbody>';
echo $tabela;
}
?>