Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mysqli_options(3) [php man page]

MYSQLI_OPTIONS(3)							 1							 MYSQLI_OPTIONS(3)

mysqli::options - Set options

       Object oriented style

SYNOPSIS
bool mysqli::options (int $option, mixed $value) DESCRIPTION
Procedural style bool mysqli_options (mysqli $link, int $option, mixed $value) Used to set extra connect options and affect behavior for a connection. This function may be called multiple times to set several options. mysqli_options(3) should be called after mysqli_init(3) and before mysqli_real_connect(3). PARAMETERS
o $ link -Procedural style only: A link identifier returned by mysqli_connect(3) or mysqli_init(3) o $option - The option that you want to set. It can be one of the following values: Valid options +---------------------------+---------------------------------------------------+ | Name | | | | | | | Description | | | | +---------------------------+---------------------------------------------------+ | | | |MYSQLI_OPT_CONNECT_TIMEOUT | | | | | | | connection timeout in seconds (supported on Win- | | | dows with TCP/IP since PHP 5.3.1) | | | | | | | | MYSQLI_OPT_LOCAL_INFILE | | | | | | | enable/disable use of LOAD LOCAL INFILE | | | | | | | | MYSQLI_INIT_COMMAND | | | | | | | command to execute after when connecting to MySQL | | | server | | | | | | | | MYSQLI_READ_DEFAULT_FILE | | | | | | | Read options from named option file instead of | | | my.cnf | | | | | | | |MYSQLI_READ_DEFAULT_GROUP | | | | | | | Read options from the named group from my.cnf or | | | the file specified with MYSQL_READ_DEFAULT_FILE. | | | | | | | | MYSQLI_SERVER_PUBLIC_KEY | | | | | | | RSA public key file used with the SHA-256 based | | | authentication. | | | | +---------------------------+---------------------------------------------------+ o $value - The value for the option. RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+-------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+-------------------------------------------------+ | 5.5.0 | | | | | | | The MYSQLI_SERVER_PUBLIC_KEY option was added. | | | | +--------+-------------------------------------------------+ EXAMPLES
See mysqli_real_connect(3). NOTES
Note MySQLnd always assumes the server default charset. This charset is sent during connection hand-shake/authentication, which mysqlnd will use. Libmysqlclient uses the default charset set in the my.cnf or by an explicit call to mysqli_options(3) prior to calling mysqli_real_connect(3), but after mysqli_init(3). SEE ALSO
mysqli_init(3), mysqli_real_connect(3). PHP Documentation Group MYSQLI_OPTIONS(3)

Check Out this Related Man Page

MYSQLI_CHARACTER_SET_NAME(3)						 1					      MYSQLI_CHARACTER_SET_NAME(3)

mysqli::character_set_name - Returns the default character set for the database connection

       Object oriented style

SYNOPSIS
string mysqli::character_set_name (void ) DESCRIPTION
Procedural style string mysqli_character_set_name (mysqli $link) Returns the current character set for the database connection. PARAMETERS
o $ link -Procedural style only: A link identifier returned by mysqli_connect(3) or mysqli_init(3) RETURN VALUES
The default character set for the current connection EXAMPLES
Example #1 mysqli::character_set_name example Object oriented style <?php /* Open a connection */ $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s ", mysqli_connect_error()); exit(); } /* Print current character set */ $charset = $mysqli->character_set_name(); printf ("Current character set is %s ", $charset); $mysqli->close(); ?> Procedural style <?php /* Open a connection */ $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (!$link) { printf("Connect failed: %s ", mysqli_connect_error()); exit(); } /* Print current character set */ $charset = mysqli_character_set_name($link); printf ("Current character set is %s ",$charset); /* close connection */ mysqli_close($link); ?> The above examples will output: Current character set is latin1_swedish_ci SEE ALSO
mysqli_set_charset(3), mysqli_client_encoding(3), mysqli_real_escape_string(3). PHP Documentation Group MYSQLI_CHARACTER_SET_NAME(3)
Man Page