该表存在,但它是空的。
表中没有数据,我等待它不会回显任何内容并读取if ($notable1 == 'on')
,但它会回.$from_month.
显和分隔符"| "
(当表不存在时,代码可以正常工作。)
问题出在哪里?我没有找到它。
foreach ($datesBooked_1_month as $value)
{
if ($result = mysqli_query($bdd, "SELECT * FROM `".$tab_from_month_year."` WHERE day = ".$value." "))
{
$data = (mysqli_fetch_assoc($result));
echo $data['day'].'/'`.$from_month.`"| ";
if ($data['roomtype_1'] <= 3) { echo $data['roomtype_1']."| " ;} else {echo "X| "; }
if ($data['roomtype_2'] <= 3) { echo $data['roomtype_2']."| " ;} else {echo "X| "; }
if ($data['roomtype_3'] <= 3) { echo $data['roomtype_3']."| " ;} else {echo "X| "; }
if ($data['roomtype_4'] <= 3) { echo $data['roomtype_4']."| " ;} else {echo "X| "; }
if ($data['roomtype_5'] <= 3) { echo $data['roomtype_5']."| " ;} else {echo "X| "; }
if ($data['roomtype_6'] <= 3) { echo $data['roomtype_6']."<br/>";} else{echo"X<br/>";}
}
else if (!$result){ $notable1 = 'on'; }
}
if ($notable1 == 'on')
{
foreach ($datesBooked_1_month as $value)
{
echo $value. "- Free #<br />";
}
}