php
connect_error) {
die("连接失败: " . $conn->connect_error);
}
echo "连接成功";
// 查询数据并展示
$sql = "SELECT * FROM your_table_name";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "字段1: " . $row["字段1"]. " - 字段2: " . $row["字段2"]. "
"; } } else { echo "0 结果"; } $conn->close(); ?>
"; } } else { echo "0 结果"; } $conn->close(); ?>
顶一下
(0)
0%
踩一下
(0)
0%
- 相关评论
- 我要评论
-