You can call the mysql_set_server_option() function to enable or disable a connection option.
Syntax
int
mysql_set_server_option(MYSQL *mysql, enum
enum_mysql_set_option option)
Return values
0 is returned for an execution success, and a non-zero value is returned if an error occurred.
Errors
CR_COMMANDS_OUT_OF_SYNC: Commands were executed in an improper order.CR_SERVER_GONE_ERROR: The connection to the OBServer was disconnected.CR_SERVER_LOST: The connection to the server was lost during the query.ER_UNKNOWN_COM_ERROR: The server did not supportmysql_set_server_option(), or the server did not support the option to be set.
Notes
The connection option can be of the following values:
MYSQL_OPTION_MULTI_STATEMENTS_ON: enables multi-statement support.MYSQL_OPTION_MULTI_STATEMENTS_OFF: disables multi-statement support.
If multi-statement support is enabled, you must retrieve the results of calling mysql_real_query() or mysql_query() by calling mysql_next_result() in a loop manner to determine whether more results exist.
The effect of enabling multi-statement support by using MYSQL_OPTION_MULTI_STATEMENTS_ON is not quite the same as that of enabling it by passing the CLIENT_MULTI_STATEMENTS flag to mysql_real_connect() (CLIENT_MULTI_STATEMENTS also enables CLIENT_MULTI_RESULTS).
MYSQL_OPTION_MULTI_STATEMENTS_ON by itself is insufficient to support the use of CALL. To use the CALL SQL statement in programs, multi-result support must be enabled.