标签:etc mysq oca localhost 数据 body 表格 rom idt
<body>
<table border="1" width="100%">
<tr>
<td>代号</td>
<td>姓名</td>
<td>性别</td>
<td>民族</td>
<td>生日</td>
<td>操作</td>
</tr>
<?php
$db =new MYSQLi("localhost","root","123","t_90052");
$sql = "select * from info";
$result =$db->query($sql);
$arr =$result->fetch_all();
foreach($arr as $v)
{
$sex = $v[2]?"男":"女";
eaho "<tr>
<td>{$v[0]}</td>
<td>{$v[1]}</td>
<td>{$sex}</td>
<td>{$v[3]}</td>
<td>{$v[4]}</td>
<td>操作</td>
</tr>";
}
?>
</table>
</body>
标签:etc mysq oca localhost 数据 body 表格 rom idt
原文地址:http://www.cnblogs.com/shandayuan/p/6939660.html