无法使用mysql_num_rows
。使用它并回显变量输出会返回一个空白输出,即使我确定有结果(因为它显示在屏幕上)
<?php
$con=mysqli_connect("localhost","root","password1","db1");
$result = mysqli_query($con, "SELECT * FROM requested_Bookings
WHERE status = 'Accepted' AND room = 'Red' ");
echo '<h5> The following are todays confirmed bookings:</h5>';
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows\n";
echo '</br>';
使用以下代码,并进一步使用echo输出查询结果,将显示该行中的所有信息,但num_rows
的值不会显示。