dbname
port
socket
flags
Return Values
Returns
on success or
TRUE
Examples
Example 20.138.
mysqli::real_connect
Object oriented style
<?php
$mysqli = mysqli_init();
if (!$mysqli) {
MySQL Improved Extension (Mysqli)
This allows one username to be used with different permissions
(depending on if a password as provided or not).
If provided will specify the default database to be used when
performing queries.
Specifies the port number to attempt to connect to the MySQL
server.
Specifies the socket or named pipe that should be used.
With the parameter
Table 20.46. Supported flags
Name
MYSQLI_CLIENT_COMPRESS
MYSQLI_CLIENT_FOUND_ROWS
MYSQLI_CLIENT_IGNORE_SPACE
MYSQLI_CLIENT_INTERACTIVE
MYSQLI_CLIENT_SSL
on failure.
FALSE
example
2407
Note
Specifying the
socket
explicitly determine the type of connection
to be used when connecting to the MySQL
server. How the connection is made to the
MySQL database is determined by the
parameter.
you can set different connection options:
flags
Description
Use compression protocol
return number of matched rows,
not the number of affected rows
Allow spaces after function
names. Makes all function
names reserved words.
Allow
interactive_timeout
seconds (instead of
wait_timeout
inactivity before closing the
connection
Use SSL (encryption)
Note
For security reasons the
flag is not supported in PHP. If you want
to execute multiple queries use the
mysqli_multi_query
parameter will not
host
seconds) of
MULTI_STATEMENT
function.
Need help?
Do you have a question about the 5.0 and is the answer not in the manual?
Questions and answers