php8.5
Home/ Manual/ mysql / functions/ mysql_get_proto_info

mysql_get_proto_info

PHP function Edit on GitHub ✎

(PHP 4 >= 4.0.5, PHP 5)

Get MySQL protocol info

Note mysqli_get_proto_info

Description

mysql_get_proto_info(resource $link_identifier = NULL): int|false

Retrieves the MySQL protocol.

Parameters

Return Values

Returns the MySQL protocol on successFalseforfailure.

Examples

mysql_get_proto_info() example

php
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
printf("MySQL protocol version: %s\n", mysql_get_proto_info());
?>

The above example will output something similar to:

output
MySQL protocol version: 10

See Also

Source: reference/mysql/functions/mysql-get-proto-info.xml · from the official PHP manual (php/doc-en)