<? 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 />"; } ?>