php中mysql_fetch_assoc() 函数如何使用

2024-10-12 16:12:42

1、新建一个php文件,命名为test.php,用于讲解php中mysql_fetch_assoc() 函数如何使用。

php中mysql_fetch_assoc() 函数如何使用

3、在test.php文件中,通过mysql_connect()方法连接数据库,并使用mysql_select_db()选择要操作的数据库test。

php中mysql_fetch_assoc() 函数如何使用

5、在test.php文件中,使用mysql_fetch_assoc()将上一步获得的结果集转换为数组形式,并使用print_r()方法将其打印出来。

php中mysql_fetch_assoc() 函数如何使用
猜你喜欢