©
Ce document utilise Manuel du site Web PHP chinois Libérer
(PHP 5)
mysqli::stmt_init -- mysqli_stmt_init — 初始化一条语句并返回一个用于mysqli_stmt_prepare(调用)的对象
面向对象风格
过程化风格
$link
)分配并初始化一个语句对象用于 mysqli_stmt_prepare() .
Note:
任何其后调用的mysqli_stmt函数都会失败直到 mysqli_stmt_prepare() 被调用.
link
仅以过程化样式:由 mysqli_connect() 或 mysqli_init() 返回的链接标识。
Returns an object.
[#1] Deepak Sati [2015-06-06 11:56:56]
If your sql query has some errors and you don't use stmt_init() before preparing the statement, you won't get error message for wrong sql query.
[#2] mamdo7 at hotmail dot com [2014-06-07 23:58:25]
you can use $stmt = $mysqli->prepare(); directly without stmt-init() . i think there is no need for stmt-init .