复制代码 代码如下:
Code highlighting produced by Actipro CodeHighlighter (freeware)><?php
//连接到本地mysql数据库,选择test为操作库
$mysqli = mysqli_connect("localhost", "root", "","test", 3306);
//用mysql_query函数从user表里读取数据
$result = mysqli_query($mysqli, "SELECT * FROM userinfo");
while($row = mysqli_fetch_array($result))//通过循环读取数据内容
{
?>
<tr>
<td><?php echo $row["ID"]?></td>
<td><?php echo $row["Name"]?></td>
<td><?php echo $row["Detail"]?></td>
</tr>
<?php
}
//关闭对数据库的连接
mysqli_free_result($result);
mysqli_close($mysqli);*/
?>
新闻热点
疑难解答