PHP MySQLi 函数

PHP mysqli_stmt::__construct() 方法用于构造新的 mysqli_stmt 对象。

语法

public mysqli_stmt::__construct(mysql, query)

参数

mysql 必填。 指定 mysqli 对象。
查询 可选。 将查询指定为字符串。如果此参数为 null,则构造函数的行为与 mysqli_stmt_init() 相同,否则其行为与 mysqli_prepare() 相同。

注意:一般情况下,您应该使用 mysqli_prepare() 或 mysqli_stmt_init() 来创建 mysqli_stmt 对象,而不是直接使用 new mysqli_stmt 实例化该对象。