作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
<分区>
我有两个 MySQL 表:
表 officehours (ID, dayslot, appt_time)表appt(ID,appt_date,appt_time)
我想选择特定日期(例如 2016-01-26)的所有办公时间,当时没有预约。 (可用预约时间)
在我的查询代码中,我有:
// get BOOKED appointment times
mysql_select_db($database_IHC, $IHC);
$query_booked18 = "SELECT appt_time FROM appt WHERE appt_date =
'".$monthyear."-".$monthnum."-18'";
$booked18 = mysql_query($query_booked18, $IHC);
// MAKE BOOKED QUERY PART OF NOT IN STATEMENT FOR AVAILABLE QUERY
while($row = mysql_fetch_array($booked18)){
$temp[] = '"'.$row[0].'"';
// PUT COMMAS BETWEEN VALUES
$bookedstmt18 = implode(",",$temp);
// AVAILABLE APPOINTMENTS QUERY
$query_available18 = "SELECT * FROM officehours WHERE dayslot =
(dayofweek('".$monthyear."-".$monthnum."-18')-1) AND appt_time NOT IN
(".$bookedstmt18.") ORDER BY (date) desc";
$available18 = mysql_query($query_available18, $IHC);
$row_available18 = mysql_fetch_assoc($available18);
$totalRows_available18 = mysql_num_rows($available18);
在我的日历显示约会的部分 (18.php),我有:
//check to see if closed first
if ($totalRows_closed18 > 0 ) {
echo "<td>CLOSED: </td><td>".$row_closed18['reason']."</td>";
echo $query_available18;
} else { // SHOW AVAILABLE APPOINTMENTS
echo '<td width="92" height="75" align="left" valign="top" style="text- align: left">';
do {
<a href="https://innerhealerchiropractic.com/index.php/appt/VIPschedule/" class="w3-link"><?php echo $row_available18['appt_time']; ?></a></br>
<?php } while ($row_available18 = mysql_fetch_assoc($available18));
echo '</td><td width="92" align="left" valign="top" style="text- align:left"> </td>';
} // END SHOW APPOINTMENTS ?>
我收到一个错误-
"Error 500 mysql_fetch_assoc() expects parameter 1 to be resource, boolean given"
谁能帮我解决这个问题?
我是一名优秀的程序员,十分优秀!