php8.5
Home/ Manual/ mysqli / mysqli_stmt/ mysqli_stmt::__construct

mysqli_stmt::__construct

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Constructs a new mysqli_stmt object

Description

mysqli_stmt::__construct(mysqli $mysql, string|null $query = null)

This method constructs a new mysqli_stmt object.

Parameters

link

A valid mysqli object.

query

The query, as a string. If this parameter is null, then the constructor behaves identically to mysqli_stmt_init(), otherwise it behaves as per mysqli_prepare().

Errors/Exceptions Conditionalexception

Changelog

VersionDescription
8.0.0query is now nullable.

See Also

Source: reference/mysqli/mysqli_stmt/construct.xml · from the official PHP manual (php/doc-en)