【发布时间】:2018-10-09 18:08:49
【问题描述】:
我想显示当前时间不在 (column)start_time 和 end_time(column) 之间的所有人员记录,但如果当前时间在 (column)start_time 和 end_time(column) 之间,则不显示人员姓名。
Sched_time_start = '17:00:00';
Sched_time_end = '17:35:00';
$time=date("h:i:s");//this is my current time variable//
这是我的查询代码:
$qry= "SELECT * from personel as A Left join sched as B on A.Per_ID = B.Sched_Per_ID where '$time' NOT BETWEEN B.Sched_time_start AND B.Sched_time_end";
$qryres = mysqli_query($connect, $qry);
所以如果当前时间在“17:00:00”和“17:35:00”之间但当当前时间低于 16:59;00 或 17:36:00 时,我不想显示人员然后在我的选择选项上显示人员姓名
这是我的选择选项代码:
<select>
<?php while ($rows=mysqli_fetch_array($qryres)) { ?>
<option><?php echo $rows['Per_fname']; ?></option>
<?php } ?>
</select>
提前致谢
【问题讨论】: