当前日期共有3条记录,但仅显示1条记录。
没有发现错误。
任何帮助将不胜感激。谢谢
<?php
require_once("connect.php");
$query = "SELECT count(*) FROM bookings WHERE bookingDate = CURDATE()";
$result = mysqli_query($link, $query);
$numRow = mysqli_num_rows($result);
echo "<h1>".$numRow."</h1>";
?>
答案 0 :(得分:5)
使用计数聚合:
SELECT count(*) as cnt FROM bookings
WHERE bookingDate = CURDATE()