PHP mysqli stat() Funksie
Voorbeeld - Objekgeoriënteerde styl
Gee die huidige stelselstatus terug:
<?php
$mysqli = new mysqli("localhost","my_user","my_password","my_db");
if ($mysqli -> connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
exit();
}
echo "System status: ". $mysqli -> stat();
$mysqli -> close();
?>
Kyk na voorbeeld van prosedurele styl onderaan.
Definisie en gebruik
Die stat() / mysqli_stat()-funksie gee die huidige stelselstatus terug.
Sintaksis
Objekgeoriënteerde styl:
$mysqli ->
stat()
Prosedure styl:
mysqli_stat(connection)
Parameterwaardes
Parameter | Description |
---|---|
connection | Required. Specifies the MySQL connection to use |
Tegniese besonderhede
Terugkeerwaarde: | 'n String wat die bedienerstatus beskryf. ONWAAR op fout |
---|---|
PHP weergawe: | 5+ |
Voorbeeld - Prosedurele styl
Gee die huidige stelselstatus terug:
<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
exit;
}
echo "System status: ". mysqli_stat($con);
mysqli_close($con);
?>
❮ PHP MySQLi-verwysing