我有以下代码
<?php
$servername = "localhost";
$username = "user";
$password = "pass";
$dbname = "database";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT id, name, time, order FROM main";
$result = mysqli_query($conn, $sql);
$num = mysqli_num_rows($result);
echo "Stuff: " . $num;
mysqli_close($conn);
?>
出于某种原因,上传到我的服务器并在我的网络浏览器上运行时,这不会返回值。任何人都可以理解为什么会这样吗?
非常感谢