mysqli_real_connect
Function • Misc changes in PHP 8.2
mysqli_real_connect Function synopsis
mysqli_real_connect(
mysqli $mysql,
?string $hostname = null,
?string $username = null,
?string $password = null,
?string $database = null,
?int $port = null,
?string $socket = null,
int $flags = 0
): bool
Parameters
$mysql
Typemysqli
$hostname
OptionalType?stringDefault valuenull
$username
OptionalType?stringDefault valuenull
$password
OptionalType?stringDefault valuenull
$database
OptionalType?stringDefault valuenull
$port
OptionalType?intDefault valuenull
$socket
OptionalType?stringDefault valuenull
$flags
OptionalTypeintDefault value0
$flags accepts one or a bitmask of the following constant values:
MYSQLI_CLIENT_COMPRESSMYSQLI_CLIENT_FOUND_ROWSMYSQLI_CLIENT_IGNORE_SPACEMYSQLI_CLIENT_INTERACTIVEMYSQLI_CLIENT_SSLMYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT
Return value
Typebool
Changes to the mysqli_real_connect Function
PHP 8.2
- Attribute added for parameter
$password:#[SensitiveParameter]
PHP 8.0
- Return type added:
bool - Parameter name of parameter #1 changed:
$linkto$mysql - Parameter type added for parameter #1 (
$mysql):mysqli - Parameter name of parameter #2 changed:
$hostto$hostname - Parameter type added for parameter #2 (
$hostname):?string - Parameter default value added for position #2 (
$hostname):null - Parameter name of parameter #3 changed:
$userto$username - Parameter type added for parameter #3 (
$username):?string - Parameter default value added for position #3 (
$username):null - Parameter type added for parameter #4 (
$password):?string - Parameter default value added for position #4 (
$password):null - Parameter type added for parameter #5 (
$database):?string - Parameter default value added for position #5 (
$database):null - Parameter type added for parameter #6 (
$port):?int - Parameter default value added for position #6 (
$port):null - Parameter type added for parameter #7 (
$socket):?string - Parameter default value added for position #7 (
$socket):null - Parameter type added for parameter #8 (
$flags):int - Parameter default value added for position #8 (
$flags):0
mysqli_real_connect(
- $link,
+ mysqli $mysql,
- $host,
+ ?string $hostname = null,
- $user,
+ ?string $username = null,
- $password,
+ ?string $password = null,
- $database,
+ ?string $database = null,
- $port,
+ ?int $port = null,
- $socket,
+ ?string $socket = null,
- $flags
+ int $flags = 0
- )
+ ): bool mysqli_real_connect Function Availability
mysqli_real_connect Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |