我正在创建查询以从MySQL数据库读取数据
所以我做了我所知道的一切,但是数据仍然不可用
$stmt = $conn->prepare("SELECT id, username, name, surname, email, password, role FROM users");
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($db_user_id, $db_username, $db_user_firstname,
$db_user_lastname, $db_email, $db_user_role);
if($stmt->num_rows > 0) {
while($stmt->fetch()) {
echo "<td>{$db_user_id}</td>";
echo "<td>{$db_user_firstname}</td>";
echo "<td>{$db_user_lastname}</td>";
echo "<td>{$db_email}</td>";
echo "<td>{$db_user_role}</td>";
echo "<td><a class='btn btn-info' href=''>Edit</a></td>";
echo "<td><a class='btn btn-danger' href=''>Delete</a></td>";
}
}
$stmt->close();
我应该有所有用户的表...但是我只是弄乱了空表...