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

PHP returns array data mysql_fetch_array() function

WBOY
Release: 2016-07-25 08:52:27
Original
1100 people have browsed it
  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


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template