php返回数组资料mysql_fetch_array()函数
时间:2021-07-01 10:21:17
帮助过:24人阅读
- $conn = mysql_connect("服务器名","用户名","密码");
- mysql_select_db("数据库名", $conn);
- $result = mysql_query("select * from table", $conn);
- while($row = mysql_fetch_array($result)) {
- echo $row["a_id"];
- echo $row["a_name"];
- }
- mysql_free_result($result);
- ?>
|