<?php
include "index.html";
header("content-type:text/html, charset=utf8");
$host = 'localhost';
$user = 'root';
$pass = 'root';
$link = mysqli_connect($host, $user, $pass, "test");
mysqli_query($link, "set names 'utf8'");
$sql = "SELECT * FROM lzq_user";
$result = mysqli_query($link, $sql);
echo "<div class='layui-container'><div class='layui-row'><table class='layui-table'><colgroup><col width='150'><col width='200'><col></colgroup><thead><tr><th>用户id</th><th>用户昵称</th><th>工作</th><th>工资</th><th>爱好</th></tr></thead><tbody>";
while ($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['job'] . "</td>";
echo "<td>" . $row['money'] . "</td>";
echo "<td>" . $row['hobby'] . "</td>";
echo "</tr>";
}
echo "</tbody>";
echo "</table>";
echo "</div>";
echo "</div>";
网友评论