mysqli_get_host_info,とは? わかりやすく解説

Weblio 辞書 > コンピュータ > PHP関数リファレンス > mysqli_get_host_info,の意味・解説 

mysqli_get_host_info,

(PHP 5)
mysqli_get_host_info, mysqli->host_info — 使用している接続の型を文字列で返す

説明

手続き型:
string mysqli_get_host_info ( mysqli link )
オブジェクト指向型(プロパティ):
class mysqli {
string host_info
} mysqli_get_host_info() は、link が使用している接続の情報を文字列で返します(サーバのホスト名を 含みます)。

パラメータ

link
手続き型のみ: mysqli_connect() あるいは mysqli_init() が返すリンク ID。

返り値

サーバのホスト名と接続の型を文字列で返します。

例 1410. オブジェクト指向型
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");

/* 接続状況をチェックします */
if (mysqli_connect_errno()) {
   printf("Connect failed: %s\n", mysqli_connect_error());
   exit();
}

/* ホスト情報を表示します */
printf("Host info: %s\n", $mysqli->host_info);

/* 接続を閉じます */
$mysqli->close();
?>

例 1411. 手続き型
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");

/* 接続状況をチェックします */
if (mysqli_connect_errno()) {
   printf("Connect failed: %s\n", mysqli_connect_error());
   exit();
}

/* ホスト情報を表示します */
printf("Host info: %s\n", mysqli_get_host_info($link));

/* 接続を閉じます */
mysqli_close($link);
?>

上の例の出力は以下となります。

Host info: Localhost via UNIX socket

  

参考

mysqli_get_proto_info()



このページでは「PHP関数リファレンス」からmysqli_get_host_info,を検索した結果を表示しています。
Weblioに収録されているすべての辞書からmysqli_get_host_info,を検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からmysqli_get_host_info, を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「mysqli_get_host_info,」の関連用語

mysqli_get_host_info,のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



mysqli_get_host_info,のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2025 by the PHP Documentation Group.

©2025 GRAS Group, Inc.RSS