Easy Tutorial
❮ Func Mysqli Num Rows Func Array Intersect Uassoc ❯

PHP mysqli_options() Function

PHP MySQLi Reference Manual

Example

Open a new connection to the MySQL server:


Definition and Usage

The mysqli_options() function sets extra connection options, which affect the behavior of the connection.

The mysqli_options() function can be called multiple times to set several options.

Note: The mysqli_options() function should be called after mysqli_init() and before mysqli_real_connect().


Syntax

Parameter Description
connection Required. Specifies the MySQL connection to use.
option Required. Specifies the option to set. Can be one of the following values: MYSQLI_OPT_CONNECT_TIMEOUT - Connection timeout in seconds<br> MYSQLI_OPT_LOCAL_INFILE - Enable/disable LOAD LOCAL INFILE<br> MYSQLI_INIT_COMMAND - Command to execute after connecting to the MySQL server<br> MYSQLI_READ_DEFAULT_FILE - Read options from the named file instead of my.cnf<br> MYSQLI_READ_DEFAULT_GROUP - Read options from the named group in my.cnf or the file specified in MYSQLI_READ_DEFAULT_FILE<br> MYSQLI_SERVER_PUBLIC_KEY - RSA public key file for SHA-256 based authentication
value Required. Specifies the value for the option.

Technical Details

Return Value: Returns TRUE on success, FALSE on failure.
PHP Version: 5+
--- ---
Changelog: Added MYSQLI_SERVER_PUBLIC_KEY option in PHP 5.5.
--- ---
❮ Func Mysqli Num Rows Func Array Intersect Uassoc ❯