当我们使用 if 语句时,我们的循环有问题,它只显示我们的一个标题,而不是所有标题
这是我们的代码:
$sqldayshours = mysqli_query($link, "SELECT * FROM event;") or die("Kon de comments niet ophalen");
$event_time = mysqli_fetch_assoc($sqldayshours);
$title = $event_time['event_title'];
$day = $event_time['event_date_day'];
$uur = $event_time['event_date_hour'];
$ide = $event_time['event_id'];
$idsql="day".$day."uur".$uur;
for($rij=8;$rij<19;$rij++)
{
echo " < tr > ";
for($i=0;$i<8;$i++)
{
$id = "day".$i."uur".$rij;
echo " < td id=\"$id\" name=\"$id\" class=\"events\">";
if($i==0){
echo $rij.":00 ";
}else{
if($idsql == $id ){
echo $title;
}
}
echo "< /td >";
}`
echo "< /tr >";
}