<?php
$host = "localhost";
$username = "root";
$pass = "";
$db = "test_db";
$conn = mysqli_connect("$host","$username","$pass");
$database = mysqli_select_db($conn, $db);
$sql = "SELECT * FROM test-table;";
$result = mysqli_query($conn, $sql);
$resultcheck = mysqli_num_rows($result);
mysqli_error($result);
if($resultcheck > 0){
while($rows = mysqli_fetch_assoc($resultcheck)){
echo $rows['']."<br>";
}
}
?>
我无法理解为什么这段代码给了我错误...还有播放mysqli_error但我确实传递了一个参数。我是php的新手,所以希望你能帮忙... 我的代码有什么问题,为什么它显示错误,我应该改变什么以便代码工作。