mysql_fetch_row.php : mysql_fetch_row « MySQL Database « PHP






mysql_fetch_row.php

 
<?
mysql_connect("localhost","root","");
mysql_select_db("mydatabase");

   $query = "SELECT id, title FROM product ORDER BY title";
   $result = mysql_query($query);
   while (list($id, $title) = mysql_fetch_row($result))
   {
      echo "Product: $title ($id) <br />";
   }
?>
  
  








Related examples in the same category

1.mysql_fetch_row() fetches rows