我尝试从今天算起订单(行)。我的输出只是print sql语句。如何解决这个问题?
<?php
$todaysDate = date("Y-m-d");
$stu_query = "select count(*) from booking where Date like '%$todaysDate%'";
print_r($stu_query);
?>
答案 0 :(得分:2)
您将在数据库中使用内置的日期常量。在MySQL中:
select count(*)
from booking
where date >= curdate();