<?php
$servername = "localhost";
$username = "root";// 数据库用户名
$password = "123123";// 数据库密码
$dbname = "123123";// 数据库名称
// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("连接失败: " . $conn->connect_error);
}
$sql = "SEL ECT id, rel FROM ayangw_order";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// 输出数据
while($row = $result->fetch_assoc()) {
echo " <tr><td>id: " . $row["id"]. "</td><td>QQ: " . $row["rel"]. "</td></tr>";
}
} else {
echo "0 结果";
}
$conn->close();
?>