当前位置:Gxlcms >
PHP教程 >
mysql_fetch_row()与mysql_fetch_array()用法区别
mysql_fetch_row()与mysql_fetch_array()用法区别
时间:2021-07-01 10:21:17
帮助过:22人阅读
- //连接到本地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))//通过循环读取数据内容
- {
- ?>
-
| -
| -
| - }
- //关闭对数据库的连接
- mysqli_free_result($result);
- mysqli_close($mysqli);*/
- ?>
|