在AJAX请求之后,我正在努力解决问题.我正在从数据库中请求数据.这本身很有效,我处理数据并将其添加到PHP文件中的表中.该表包含一个标题,后跟数据.然后将该表传送到显示它的主页面.我的问题是我正在尝试格式化我在PHP中创建的按钮以进行格式化.这是带有数据请求的PHP
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql = "SELECT LoginName FROM table";
$res = mysqli_query($conn, $sql);
if (mysqli_num_rows($res) > 0) {
echo "<center>";
echo "<table border='1'>";
echo "<tr>";
echo "<td>User</td>";
echo "<td colspan=2 align=center>Available Functions</td>";
echo "</tr>";
while($row = mysqli_fetch_assoc($res)) {
echo "<tr>";
echo "<td>" . $row['User'] . "</td>";
echo "<td><button type='button' class='smallbutton'>Delete User</button></td>";
echo "<td><button type='button' class='smallbutton'>Change Password</button></td>";
echo "</tr>";
}
echo "</table>";
echo "</center>";
} else {
echo "";
} …Run Code Online (Sandbox Code Playgroud)