从今天开始计算订单

时间:2020-07-26 17:44:04

标签: php sql

我尝试从今天算起订单(行)。我的输出只是print sql语句。如何解决这个问题?

<?php
$todaysDate = date("Y-m-d");
$stu_query = "select count(*) from booking where Date like '%$todaysDate%'";
print_r($stu_query);
?>

1 个答案:

答案 0 :(得分:2)

您将在数据库中使用内置的日期常量。在MySQL中:

select count(*)
from booking
where date >= curdate();