I'm creating a small table that has 7 columns, the first row of each column represents one day and the remaining times are that day's schedule.
I want the times that are stored in the database to be highlighted in this table. I tried in some ways, I did not succeed and I would like some help.
Here is the code, and I apologize for any basic error, I'm still not very familiar with PHP.
<table border="1">
<?php
$query = array();
echo '<tr>';
for ($i = 1; $i <= 7; $i++) {
$data = date('d-m-Y',strtotime('+' . $i . ' days'));
$query[$i] = mysql_query ("SELECT hora_consulta FROM consulta WHERE data_consulta = '$data'");
echo '<td>' . $data . '</td>';
}
echo '</tr>';
$horario = '08:00';
while (strtotime($horario) < strtotime('20:00')) {
echo '<tr>';
echo '<td>' . $horario . '</td>' .
'<td>' . $horario . '</td>' .
'<td>' . $horario . '</td>' .
'<td>' . $horario . '</td>' .
'<td>' . $horario . '</td>' .
'<td>' . $horario . '</td>' .
'<td>' . $horario . '</td>' ;
$horario = strtotime("$horario + 30 minutes");
$horario = date("H:i",$horario);
echo '</tr>';
}
?>
</table>