<?php header("Content-Type: text/html; charset=gb2312");?>
<?php header("Cache-Control: no-Cache");?>
<?php
$conn = mysql_connect("127.0.0.1","root");
mysql_select_db("test",$conn);
$table = mysql_query("select * from UserInfo");
?>
<style type="text/css">
table{width:300px;}
table,td{
border:solid 1px #000;
margin:0px 0px 0px 0px;
padding:2px;
border-collapse:collapse;
text-align:center;
}
</style>
<table>
<tr><td>姓名</td></tr>
<?
while($row = mysql_fetch_array($table))
{?>
<tr><td><?echo $row["UserName"];?></td></tr>
<?}?>
</table>
PHP连接MYSQL数据库
最新推荐文章于 2024-04-25 11:28:18 发布