Forum Moderators: coopster
Warning: mysqli_stmt::bind_param() [function.bind-param]: Number of variables doesn't match number of parameters in prepared statement
The problem is as far as i can see the number of variables im using is equal to the number of parameters.
$stmt = $mysqli->prepare( "SELECT
surname
FROM
customer
WHERE
(surname LIKE '?%')" );
if ( $stmt ) {
$stmt->bind_param("s",$surname);
$stmt->execute();
$stmt->bind_result($surnames);
if ( $stmt->fetch() ) {
print "Get firstname from result $surnames \n";
} else {
print 'Sorry, no records found.';
}
I'm not sure if either of these will work, and I know I changed your query, but if it works then you know it is your query that is the problem. Good luck and I really wish I could have helped you better.