I am relatively new to PHP and am working on learning binding. I am getting a bind error:
mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement
if( isset( $_GET['last_name'],$_GET['id'] )) {
$last_name = trim($_GET['last_name']);
$id = trim($_GET['id']);
$people = $db->prepare( "select firstName, last_name, id from people where last_name = ? or id >= ?");
$people->bind_param('ssi', $first_name, $last, $id);
$people->execute();
$people->bind_result( $first_name, $last, $id );
I'm getting the error on the bind_param line. I have 'ssi" which I though meant string, string, integer, and I have three variables. In my select, I have three correctly named fields. If I change to "si" and remove either name field, it works fine. so I am puzzled why adding a second string does not work.