In the following example, does the while loop with mysql_fetch_array() query
the server each time through the loop? Or does it do everything, while
parsing, using $result? Or is there some other subtlety I'm missing? How
is this working and where is the work being done?
Thanks, Glenn.
<?php
mysql_connect($host, $user, $password);
mysql_select_db("database");
$result = mysql_query("select user_id, fullname from table");
while ($row = mysql_fetch_array($result)) {
echo "user_id: ".$row["user_id"]."<br>\n";
echo "user_id: ".$row[0]."<br>\n";
echo "fullname: ".$row["fullname"]."<br>\n";
echo "fullname: ".$row[1]."<br>\n";
}
mysql_free_result($result);
?>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php