C API Function Descriptions
2189
mysql_store_result()
returns a null pointer if the statement didn't return a result set (for example,
if it was an
INSERT
statement).
mysql_store_result()
also returns a null pointer if reading of the result set failed. You can
check whether an error occurred by checking whether
mysql_error()
returns a nonempty string,
mysql_errno()
returns nonzero, or
mysql_field_count()
returns zero.
An empty result set is returned if there are no rows returned. (An empty result set differs from a null
pointer as a return value.)
After you have called
mysql_store_result()
and gotten back a result that isn't a null pointer, you
can call
mysql_num_rows()
to find out how many rows are in the result set.
You can call
mysql_fetch_row()
to fetch rows from the result set, or
mysql_row_seek()
and
mysql_row_tell()
to obtain or set the current row position within the result set.
See
Section 20.6.13.1, “Why
mysql_store_result()
Sometimes Returns
NULL
After
mysql_query()
Returns Success”
.
Return Values
A
MYSQL_RES
result structure with the results.
NULL
(0) if an error occurred.
Errors
mysql_store_result()
resets
mysql_error()
and
mysql_errno()
if it succeeds.
•
CR_COMMANDS_OUT_OF_SYNC
[2942]
Commands were executed in an improper order.
•
CR_OUT_OF_MEMORY
[2942]
Out of memory.
•
CR_SERVER_GONE_ERROR
[2942]
The MySQL server has gone away.
•
CR_SERVER_LOST
[2942]
The connection to the server was lost during the query.
•
CR_UNKNOWN_ERROR
[2941]
An unknown error occurred.
20.6.6.70.
mysql_thread_id()
unsigned long mysql_thread_id(MYSQL *mysql)
Description
Returns the thread ID of the current connection. This value can be used as an argument to
mysql_kill()
to kill the thread.
If the connection is lost and you reconnect with
mysql_ping()
, the thread ID changes. This means
you should not get the thread ID and store it for later. You should get it when you need it.
Note
This function does not work correctly if thread IDs become larger than
32 bits, which can occur on some systems. To avoid problems with
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...