php实现从数据库查询数据 (使用MySQLi)
发表于:2024-03-02 20:39:19浏览:91次
PHP从数据库查询数据 (使用MySQLi):
<?php
$conn = mysqli_connect("localhost", "username", "password", "database");
$result = mysqli_query($conn, "SELECT * FROM users");
while ($row = mysqli_fetch_assoc($result)) {
echo "Name: " . $row['name'] . "<br>";
}
mysqli_close($conn);
?>
栏目分类全部>