mahy 2013-06-05
代码如下:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?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 align="center" height="19"><?php echo $row["ID"]?></td> <td align="center"><?php echo $row["Name"]?></td> <td align="center"><?php echo $row["Detail"]?></td> </tr> <?php } //关闭对数据库的连接 mysqli_free_result($result); mysqli_close($mysqli);*/ ?>