[英]I want to display all personnel records that the current time is not between to the (column)start_time and end_time(column)
I want to display all personnel records that the current time is not between to the (column)start_time and end_time(column) but if the current time is between to the (column)start_time and end_time(column) then dont display the personnel name. 我想显示所有人员记录,即当前时间不在(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//
here's my query code: 这是我的查询代码:
$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);
so I dont want to display the personnel if the current time is between '17:00:00' and '17:35:00' but when the current time is bellow 16:59;00 or 17:36:00 above then the personnel name display on my select option 因此,如果当前时间在“ 17:00:00”和“ 17:35:00”之间,但我不想显示人员,但是当当前时间在以下时间16:56; 00或17:36:00时,人员名称显示在我的选择选项上
here's my select option code: 这是我的选择选项代码:
<select>
<?php while ($rows=mysqli_fetch_array($qryres)) { ?>
<option><?php echo $rows['Per_fname']; ?></option>
<?php } ?>
</select>
Thanks in advance 提前致谢
It could be multiple things: 可能有很多事情:
h
: date("h:i:s");
h
格式化时间: date("h:i:s");
. date("H:i:s");
date("H:i:s");
. DATETIME
instead of TIME
type in your MYSQL table structure for the schedule start and end columns you'll have to include the day, month and year in your $time
variable. DATETIME
而不是TIME
类型作为计划开始和结束列,则必须在$time
变量中包括日,月和年。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.