Complete the code to prepare a SQL statement.
$stmt = $conn->[1]("SELECT * FROM users WHERE id = ?");
The prepare method creates a prepared statement for execution.
Complete the code to bind a parameter to the prepared statement.
$stmt->[1]("i", $userId);
The bind_param method binds variables to the parameter markers in the SQL statement.
Fix the error in executing the prepared statement.
$stmt->[1]();The execute method runs the prepared statement after binding parameters.
Fill both blanks to fetch the result from the executed statement.
$stmt->[1](); $stmt->[2]();
First, execute() runs the statement, then bind_result() binds variables to the columns in the result set.
Fill all three blanks to complete a safe prepared statement workflow.
$stmt = $conn->[1]("SELECT name FROM users WHERE id = ?"); $stmt->[2]("i", $id); $stmt->[3]();
The correct order is to prepare the statement, bind parameters, then execute it.
