MySQL Improved Extension (
Mysqli
)
2306
also
MySQL: choosing an API
guide and
related FAQ
for more information.
Alternatives to this function include:
See:
Buffered and Unbuffered queries
Description
resource mysql_unbuffered_query(
string query,
resource link_identifier
= =NULL);
mysql_unbuffered_query
sends the SQL query
query
to MySQL without automatically
fetching and buffering the result rows as
mysql_query
does. This saves a considerable amount of
memory with SQL queries that produce large result sets, and you can start working on the result set
immediately after the first row has been retrieved as you don't have to wait until the complete SQL
query has been performed. To use
mysql_unbuffered_query
while multiple database connections
are open, you must specify the optional parameter
link_identifier
to identify which connection
you want to use.
Parameters
query
The SQL query to execute.
Data inside the query should be
properly escaped
.
link_identifier
The MySQL connection. If the link identifier is not specified, the
last link opened by
mysql_connect
is assumed. If no such link
is found, it will try to create one as if
mysql_connect
was called
with no arguments. If no connection is found or established, an
E_WARNING
level error is generated.
Return Values
For SELECT, SHOW, DESCRIBE or EXPLAIN statements,
mysql_unbuffered_query
returns a
resource on success, or
FALSE
on error.
For other type of SQL statements, UPDATE, DELETE, DROP, etc,
mysql_unbuffered_query
returns
TRUE
on success or
FALSE
on error.
Notes
Note
The benefits of
mysql_unbuffered_query
come at a cost: you cannot use
mysql_num_rows
and
mysql_data_seek
on a result set returned from
mysql_unbuffered_query
, until all rows are fetched. You also have to fetch
all result rows from an unbuffered SQL query before you can send a new SQL
query to MySQL, using the same
link_identifier
.
See Also
mysql_query
20.7.3. MySQL Improved Extension (
Mysqli
)
Copyright 1997-2012 the PHP Documentation Group. [2230]
The
mysqli
extension allows you to access the functionality provided by MySQL 4.1 and above. More
information about the MySQL Database server can be found at http://www.mysql.com/
An overview of software available for using MySQL from PHP can be found at
Section 20.7.3.2,
“Overview”
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...