you can use $stmt = $mysqli->prepare(); directly without stmt-init() . i think there is no need for stmt-init .
(PHP 5, PHP 7)
mysqli::stmt_init -- mysqli_stmt_init — Initializes a statement and returns an object for use with mysqli_stmt_prepare
Object oriented style
Procedural style
Allocates and initializes a statement object suitable for mysqli_stmt_prepare().
Note:
Any subsequent calls to any mysqli_stmt function will fail until mysqli_stmt_prepare() was called.
link
Procedural style only: A link identifier returned by mysqli_connect() or mysqli_init()
Returns an object.
you can use $stmt = $mysqli->prepare(); directly without stmt-init() . i think there is no need for stmt-init .
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.