I have PHP version 5.5.9-1 and having trouble with call_user_func_array and bind_param for stmt. I have the following code
$query = "SELECT * FROM studentTable WHERE firstname = ?";
if(!($stmt = $conn->prepare($query))){
echo "Prepare failed: (" . $conn->errno . ") " . $conn->error;
return;
}
$paramType= 's';
$paramValue= 'bob';
$a_params = array(&$paramType, &$paramValue);
call_user_func_array(array($stmt, 'bind_param'),$a_params)
I am getting the following error and I don't know why
Binding parameters failed: (0)
I have tried wrapping the strings "'s'" but that reports that there is not enough arguments. What am i doing wrong?
Thank you
UPDATE
I have tried the code from php5.3 - mysqli_stmt:bind_params with call_user_func_array warnings but still not working