Oracle 5.0 Reference Manual page 2210

Table of Contents

Advertisement

Return Values
The thread ID of the current connection.
Errors
None.
20.6.6.71.
mysql_use_result()
MYSQL_RES *mysql_use_result(MYSQL *mysql)
Description
After invoking
or
mysql_use_result()
DESCRIBE, EXPLAIN,
you are done with the result set.
mysql_use_result()
client like
mysql_store_result()
calls to mysql_fetch_row(). This reads the result of a query directly from the server without storing
it in a temporary table or local buffer, which is somewhat faster and uses much less memory than
mysql_store_result(). The client allocates memory only for the current row and a communication
buffer that may grow up to
On the other hand, you shouldn't use
each row on the client side, or if the output is sent to a screen on which the user may type a
scroll). This ties up the server and prevent other threads from updating any tables from which the data
is being fetched.
When using mysql_use_result(), you must execute
returned, otherwise, the unfetched rows are returned as part of the result set for your next query. The C
API gives the error
to do this!
You may not use mysql_data_seek(), mysql_row_seek(), mysql_row_tell(),
mysql_num_rows(), or
mysql_use_result(), nor may you issue other queries until
(However, after you have fetched all the rows,
rows fetched.)
You must call
When using the
memory usage incrementally increases with each row retrieved until
called.
Return Values
A
MYSQL_RES
Errors
mysql_use_result()
CR_COMMANDS_OUT_OF_SYNC
Commands were executed in an improper order.
C API Function Descriptions
mysql_thread_id(), do not use it. To get the connection ID, execute a
SELECT CONNECTION_ID()
or mysql_real_query(), you must call
mysql_query()
for every statement that successfully produces a result set (SELECT, SHOW,
TABLE, and so forth). You must also call
CHECK
initiates a result set retrieval but does not actually read the result set into the
max_allowed_packet
Commands out of sync; you can't run this command now
mysql_affected_rows()
mysql_free_result()
embedded server, the memory benefits are essentially lost because
libmysqld
result structure.
NULL
resets
mysql_error()
[2942]
query and retrieve the result.
does. Instead, each row must be retrieved individually by making
[466]
bytes.
mysql_use_result()
mysql_fetch_row()
with a result returned from
mysql_num_rows()
once you are done with the result set.
if an error occurred.
and
mysql_errno()
2190
mysql_store_result()
mysql_free_result()
if you are doing a lot of processing for
until a
mysql_use_result()
accurately returns the number of
mysql_free_result()
if it succeeds.
after
(stop
^S
value is
NULL
if you forget
has finished.
is

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents