【发布时间】:2017-11-30 19:28:45
【问题描述】:
我正在创建用户管理系统仪表板,我想在其中显示我的用户列表,如电子商务网站产品列表
我的php代码是。
<?php
$connect = mysqli_connect("localhost", "root", "xxxxx", "xxxxx");
$query = "SELECT * FROM users";
$result = mysqli_query($connect, $query);
?>
<div style="width:700px;">
<div class="table-responsive">
<table class="table table-bordered">
<tr>
<th width="20%">Location</th>
<th width="20%">Employee Name</th>
<th width="30%">Last Login</th>
<th width="30%">View</th>
</tr>
<?php
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row["Location"]; ?></td>
<td><?php echo $row["userName"]; ?></td>
<td><?php echo $row["session"]; ?></td>
<td><input type="button" name="view" value="view" id="<?php echo $row["userEmail"]; ?>" class="btn btn-info btn-xs view_data" /></td>
</tr>
<?php
}
?>
</table>
</div>
</div>
我希望我的用户输出看起来应该是动态的。
User-1 | User 2 | User 3 | User 4
User-5 | User 6 | User 7 | User 8
User-9 | User 10 | User 11 | User 12
请帮忙。
【问题讨论】:
-
可以使用引导网格布局代替表格。