PHP 8.3.4 Released!

mysqli::$protocol_version

mysqli_get_proto_info

(PHP 5, PHP 7, PHP 8)

mysqli::$protocol_version -- mysqli_get_proto_infoLiefert die Version des verwendeten MySQL-Protokolls

Beschreibung

Objektorientierter Stil

Prozeduraler Stil

mysqli_get_proto_info(mysqli $mysql): int

Gibt einen Integerwert zurück, der die Version des MySQL-Protokolls angibt, das von der durch den Parameter mysql angegebenen Verbindung verwendet wird.

Parameter-Liste

mysql

Nur bei prozeduralem Aufruf: ein von mysqli_connect() oder mysqli_init() zurückgegebenes mysqli-Objekt.

Rückgabewerte

Gibt einen Integerwert zurück, der die Protokoll-Version angibt.

Beispiele

Beispiel #1 $mysqli->protocol_version-Beispiel

Objektorientierter Stil

<?php

mysqli_report
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli("localhost", "my_user", "my_password");

/* Protokoll-Version ausgeben */
printf("Protokoll-Version: %d\n", $mysqli->protocol_version);

Prozeduraler Stil

<?php

mysqli_report
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$link = mysqli_connect("localhost", "my_user", "my_password");

/* Protokoll-Version ausgeben */
printf("Protokoll-Version: %d\n", mysqli_get_proto_info($link));

Die obigen Bespiele erzeugen folgende Ausgabe:

Protokoll-Version: 10

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top