Home >Backend Development >PHP Tutorial >PHP returns array data mysql_fetch_array() function

PHP returns array data mysql_fetch_array() function

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-25 08:52:271129browse
  1. $conn = mysql_connect("server name", "username", "password");
  2. mysql_select_db("database name", $conn);
  3. $result = mysql_query("select * from table", $conn);
  4. while($row = mysql_fetch_array($result)) {
  5. echo $row["a_id"];
  6. echo $row["a_name"];
  7. }
  8. mysql_free_result($result) ;
  9. ?>
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn