它有一个错误 "试图获取非对象的属性'num_rows'"。
'<?php'
'require_once "connect.php";'
'$sql = "SELECT No,TimeIssued,Type FROM QueueR WHERE Type='Regular'";'
'$result = $conn->query($sql);'
'if($result->num_rows > 0){'
'echo "<table class='table table-bordered table-striped'>";'
'echo "<thead>";'
'echo "<tr>";'
'echo "<th>No</th>";'
'echo "<th>TimeIssued</th>";'
'echo "</tr>";'
'echo "</thead>";'
'echo "<tbody>";'
'while($row = $result->fetch_assoc()){'
'echo "<tr>";'
'echo "<td>" . $row['No'] . "</td>";'
'echo "<td>" . $row['TimeIssued'] . "</td>";'
'echo "</tr>";'
'}'
'echo "</tbody>";'
'echo "</table>";'
'$result->free();'
'} else{'
'echo "<p class='lead'><em>No records were found.</em></p>";'
'}'
'?>'
'''
检查是否 $conn
中的connect.php连接正常。
试着在mysql客户端测试查询。
使用 include("connect.php")
而不是 require_once "connect.php"
.