C API Function Descriptions
2170
mysql_num_rows()
does not return the correct value until all the rows in the result set have been
retrieved.
mysql_num_rows()
is intended for use with statements that return a result set, such as
SELECT
. For
statements such as
INSERT
,
UPDATE
, or
DELETE
, the number of affected rows can be obtained with
mysql_affected_rows()
.
Return Values
The number of rows in the result set.
Errors
None.
20.6.6.49.
mysql_options()
int mysql_options(MYSQL *mysql, enum mysql_option option, const char *arg)
Description
Can be used to set extra connect options and affect behavior for a connection. This function may be
called multiple times to set several options.
Call
mysql_options()
after
mysql_init()
and before
mysql_connect()
or
mysql_real_connect()
.
The
option
argument is the option that you want to set; the
arg
argument is the value for the option.
If the option is an integer, specify a pointer to the value of the integer as the
arg
argument.
The following list describes the possible options, their effect, and how
arg
is used for each option.
Several of the options apply only when the application is linked against the
libmysqld
embedded
server library and are unused for applications linked against the
libmysqlclient
client library. For
option descriptions that indicate
arg
is unused, its value is irrelevant; it is conventional to pass 0.
•
MYSQL_INIT_COMMAND
(argument type:
char *
)
SQL statement to execute when connecting to the MySQL server. Automatically re-executed if
reconnection occurs.
•
MYSQL_OPT_COMPRESS
(argument: not used)
Use the compressed client/server protocol.
•
MYSQL_OPT_CONNECT_TIMEOUT
(argument type:
unsigned int *
)
Connect timeout in seconds.
•
MYSQL_OPT_GUESS_CONNECTION
(argument: not used)
For an application linked against the
libmysqld
embedded server library, this enables the library
to guess whether to use the embedded server or a remote server. “Guess” means that if the
host name is set and is not
localhost
, it uses a remote server. This behavior is the default.
MYSQL_OPT_USE_EMBEDDED_CONNECTION
and
MYSQL_OPT_USE_REMOTE_CONNECTION
can be
used to override it. This option is ignored for applications linked against the
libmysqlclient
client
library.
•
MYSQL_OPT_LOCAL_INFILE
(argument type: optional pointer to
unsigned int
)
If no pointer is given or if pointer points to an
unsigned int
that has a nonzero value, the
LOAD
LOCAL INFILE
statement is enabled.
•
MYSQL_OPT_NAMED_PIPE
(argument: not used)
Содержание 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 ...