mysql_unbuffered_query()
resource mysql_unbuffered_query(sql_statement[,connection])
Use this function to execute an SQL statement given without
buffering the results so that you can retrieve the data without having
to wait for the results set to be completed. You may give an
identifier as a second argument to interface with a different
connection. The function returns false if the query is unsuccessful.
For SQL statements that do not return a results set based on their
nature (e.g., INSERT), the function returns true
when successful. Use this function with care because an enormous
results set could overwhelm the program’s allocated memory. Here is an
example:
...
$sql_stmnt = "SELECT wrid, client_name, description
FROM workreq, clients
WHERE workreq.clientid = clients.clientid";
$results = mysql_unbuffered_query($sql_stmnt, $connection);
while($row = mysql_fetch_row($results)) {
print "WR-$row[0]: $row[1] - $row[2] \n";
}
...There’s no difference in the syntax of
mysql_unbuffered_query() and
mysql_query(), nor in the handling of the
results. The only differences in this function are the speed for large
databases and the fact that functions such as
mysql_num_row() and
mysql_data_seek() cannot be used, because the
results set is not buffered and therefore cannot be analyzed by these
functions.