I want to catch this error:
Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables
A solution was provided here, but it does not catch the error for some reason.
$rc = $stmt->bind_param('iii', $x, $y, $z);
// bind_param() can fail because the number of parameter doesn't match the placeholders in the statement
// or there's a type conflict(?), or ....
if ( false===$rc ) {
// again execute() is useless if you can't bind the parameters. Bail out somehow.
die('bind_param() failed: ' . htmlspecialchars($stmt->error));
}
$rc
returns 1 even if the number of bind parameters mismatch...