谁能帮我吗?我想显示完整的 mysql 数据库表结果,但出现错误:
我们有联系。
警告:mysqli_fetch_row() 期望参数 1 为 mysqli_result,第 28 行 C:\xampp\htdocs\test\fetch.php 中给出的字符串
$connection = mysqli_connect('127.0.0.1:3307','root','','loginapp');
if($connection){
echo "We are connected.";
}
$query = "SELECT * FROM users";
mysqli_query($connection,$query);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Display</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="col-md-6">
<?php while($result = mysqli_fetch_row($query)){
print_r($result);
} ?>
</div>
</div>
</body>
</html> ```
慕丝7291255