update page now
PHP 8.4.22 Released!

La classe mysqli

(PHP 5, PHP 7, PHP 8)

Introduction

Représente une connexion entre PHP et une base de données MySQL.

Synopsis de la classe

class mysqli {
/* Propriétés */
public readonly int|string $affected_rows;
public readonly string $client_info;
public readonly int $client_version;
public readonly int $connect_errno;
public readonly ?string $connect_error;
public readonly int $errno;
public readonly string $error;
public readonly array $error_list;
public readonly int $field_count;
public readonly string $host_info;
public readonly ?string $info;
public readonly int|string $insert_id;
public readonly string $server_info;
public readonly int $server_version;
public readonly string $sqlstate;
public readonly int $protocol_version;
public readonly int $thread_id;
public readonly int $warning_count;
/* Méthodes */
public function __construct(
    ?string $hostname = null,
    ?string $username = null,
    #[\SensitiveParameter] ?string $password = null,
    ?string $database = null,
    ?int $port = null,
    ?string $socket = null
)
public function autocommit(bool $enable): bool
public function begin_transaction(int $flags = 0, ?string $name = null): bool
public function change_user(string $username, #[\SensitiveParameter] string $password, ?string $database): bool
public function character_set_name(): string
public function close(): true
public function commit(int $flags = 0, ?string $name = null): bool
public function connect(
    ?string $hostname = null,
    ?string $username = null,
    #[\SensitiveParameter] ?string $password = null,
    ?string $database = null,
    ?int $port = null,
    ?string $socket = null
): bool
public function debug(string $options): true
public function dump_debug_info(): bool
public function execute_query(string $query, ?array $params = null): mysqli_result|bool
public function get_charset(): ?object
public function get_connection_stats(): array
public function get_server_info(): string
public function get_warnings(): mysqli_warning|false
#[\Deprecated]
public function init(): ?bool
#[\Deprecated]
public function kill(int $process_id): bool
public function more_results(): bool
public function multi_query(string $query): bool
public function next_result(): bool
public function options(int $option, string|int $value): bool
#[\Deprecated]
public function ping(): bool
public static function poll(
    ?array &$read,
    ?array &$error,
    array &$reject,
    int $seconds,
    int $microseconds = 0
): int|false
public function prepare(string $query): mysqli_stmt|false
public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool
public function real_connect(
    ?string $hostname = null,
    ?string $username = null,
    #[\SensitiveParameter] ?string $password = null,
    ?string $database = null,
    ?int $port = null,
    ?string $socket = null,
    int $flags = 0
): bool
public function real_escape_string(string $string): string
public function real_query(string $query): bool
#[\Deprecated]
public function refresh(int $flags): bool
public function release_savepoint(string $name): bool
public function rollback(int $flags = 0, ?string $name = null): bool
public function savepoint(string $name): bool
public function select_db(string $database): bool
public function set_charset(string $charset): bool
public function ssl_set(
    ?string $key,
    ?string $certificate,
    ?string $ca_certificate,
    ?string $ca_path,
    ?string $cipher_algos
): true
public function stat(): string|false
public function stmt_init(): mysqli_stmt|false
public function store_result(int $mode = 0): mysqli_result|false
public function thread_safe(): bool
public function use_result(): mysqli_result|false
}

Sommaire

add a note

User Contributed Notes

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