PHP Conference Japan 2024

mysqli 類別

(PHP 5, PHP 7, PHP 8)

簡介

表示 PHP 與 MySQL 資料庫之間的連線。

類別概要

class mysqli {
/* 屬性 */
public readonly int|string $affected_rows;
public readonly string $client_info;
public readonly int $client_version;
公開 唯讀 整數 $connect_errno;
公開 唯讀 ?字串 $connect_error;
公開 唯讀 整數 $errno;
公開 唯讀 字串 $error;
公開 唯讀 陣列 $error_list;
公開 唯讀 整數 $field_count;
公開 唯讀 字串 $host_info;
公開 唯讀 ?字串 $info;
公開 唯讀 整數|字串 $insert_id;
公開 唯讀 字串 $server_info;
公開 唯讀 整數 $server_version;
公開 唯讀 字串 $sqlstate;
公開 唯讀 整數 $protocol_version;
公開 唯讀 整數 $thread_id;
公開 唯讀 整數 $warning_count;
/* 方法 */
公開 __construct(
    ?字串 $hostname = null,
    ?字串 $username = null,
    #[\SensitiveParameter] ?字串 $password = null,
    ?字串 $database = null,
    ?整數 $port = null,
    ?字串 $socket = null
)
公開 開始交易(整數 $flags = 0, ?字串 $name = null): 布林值
公開 變更使用者(字串 $username, #[\SensitiveParameter] 字串 $password, ?字串 $database): 布林值
公開 關閉(): true
公開 提交(整數 $flags = 0, ?字串 $name = null): 布林值
公開 連線(
    ?字串 $hostname = null,
    ?字串 $username = null,
    #[\SensitiveParameter] ?字串 $password = null,
    ?字串 $database = null,
    ?整數 $port = null,
    ?字串 $socket = null
): 布林值
公開 除錯(字串 $options): true
公開 multi_query(字串 $query): 布林值
公開 options(整數 $option, 字串|整數 $value): 布林值
公開 靜態 poll(
    ?陣列 &$read,
    ?陣列 &$error,
    陣列 &$reject,
    整數 $seconds,
    整數型 (int) $microseconds = 0
): 整數型 (int)|false
公開 (public) prepare(字串 (string) $query): mysqli_stmt|false
公開 (public) real_connect(
    ?字串 $hostname = null,
    ?字串 $username = null,
    #[\SensitiveParameter] ?字串 $password = null,
    ?字串 $database = null,
    ?整數 $port = null,
    ?字串 $socket = null,
    整數型 (int) $flags = 0
): 布林值
公開 (public) rollback(整數型 (int) $flags = 0, ?字串 (string) $name = null): 布林值 (bool)
public select_db(字串 $database): 布林值
public set_charset(字串 $charset): 布林值
public ssl_set(
    ?字串 $key,
    ?字串 $certificate,
    ?字串 $ca_certificate,
    ?字串 $ca_path,
    ?字串 $cipher_algos
): true
public stat(): 字串|false
}

目錄

新增註釋

使用者貢獻的註釋

此頁面沒有使用者貢獻的註釋。
To Top