復制代碼 代碼如下:
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);*/
?>
新聞熱點
疑難解答