我在某些代码中有以下查询...
$student_result = db_query("select id,timestamp,time_id,unschedule_code from student where canceled='0' and email='".$email."' and timestamp > '".time()."'");
我想要更改时间戳> '“.time()。”'“);到时间 - 1天。我尝试了类似......
$student_result = db_query("select id,timestamp,time_id,unschedule_code from student where canceled='0' and email='".$email."' and timestamp > '".time(). - 1"'");
......没有运气。页面无法加载,因此我确信语法甚至无效。任何帮助表示赞赏...
答案 0 :(得分:2)
时间戳以秒为单位,请尝试:
$student_result = db_query("select id,timestamp,time_id,unschedule_code from student where canceled='0' and email='".$email."' and timestamp > '".(time()-(3600*24))."'");