function mysql_fetch_array() accomplishes the same result as mysql_fetch_row(), by default it assigns a returned row to an associative array. : mysqli_fetch_array « MySQL Database « PHP






function mysql_fetch_array() accomplishes the same result as mysql_fetch_row(), by default it assigns a returned row to an associative array.

 
array mysql_fetch_array (int result [, result_type])

<?
@mysql_connect("localhost", "root","") or die("Could not connect to MySQL server!");
@mysql_select_db("mydatabase") or die("Could not select database!");
$query = "SELECT * FROM mytable";
$result = mysql_query($query);

while ($row = mysql_fetch_array($result)) :
   print $row["id"];
endwhile;
mysql_close();
?>
  
  








Related examples in the same category

1.Using the mysqli_fetch_array() Function