The mysqli class

(PHP 5, PHP 7, PHP 8)

Introduction

Represents a connection between PHP and a MySQL database.

Class synopsis

classmysqli {
publicreadonlyint|string$affected_rows;
publicreadonlystring$client_info;
publicreadonlyint$client_version;
publicreadonlyint$connect_errno;
publicreadonly?string$connect_error;
publicreadonlyint$errno;
publicreadonlystring$error;
publicreadonlyarray$error_list;
publicreadonlyint$field_count;
publicreadonlystring$host_info;
publicreadonly?string$info;
publicreadonlyint|string$insert_id;
publicreadonlystring$server_info;
publicreadonlyint$server_version;
publicreadonlystring$sqlstate;
publicreadonlyint$protocol_version;
publicreadonlyint$thread_id;
publicreadonlyint$warning_count;
public__construct(
    ?string$hostname = null,
    ?string$username = null,
    ?string$password = null,
    ?string$database = null,
    ?int$port = null,
    ?string$socket = null
)
publicautocommit(bool$enable): bool
publicbegin_transaction(int$flags = 0, ?string$name = null): bool
publicchange_user(string$username, string$password, ?string$database): bool
publicclose(): true
publiccommit(int$flags = 0, ?string$name = null): bool
publicconnect(
    ?string$hostname = null,
    ?string$username = null,
    ?string$password = null,
    ?string$database = null,
    ?int$port = null,
    ?string$socket = null
): bool
publicdebug(string$options): true
publicinit(): ?bool
publickill(int$process_id): bool
publicmulti_query(string$query): bool
publicnext_result(): bool
publicoptions(int$option, string|int$value): bool
publicping(): bool
publicstaticpoll(
    ?array&$read,
    ?array&$error,
    array&$reject,
    int$seconds,
    int$microseconds = 0
): int|false
publicquery(string$query, int$result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool
publicreal_connect(
    ?string$hostname = null,
    ?string$username = null,
    ?string$password = null,
    ?string$database = null,
    ?int$port = null,
    ?string$socket = null,
    int$flags = 0
): bool
publicreal_query(string$query): bool
publicrefresh(int$flags): bool
publicrollback(int$flags = 0, ?string$name = null): bool
publicsavepoint(string$name): bool
publicselect_db(string$database): bool
publicset_charset(string$charset): bool
publicssl_set(
    ?string$key,
    ?string$certificate,
    ?string$ca_certificate,
    ?string$ca_path,
    ?string$cipher_algos
): true
publicstat(): string|false
publicthread_safe(): bool
}

Table of Contents

To Top