While binding variable to my prepared statement PHP reports that the number of parameters do not match !
here is the code:
private $q_setQueue = "update rivr_queues set name='?', description='?' where QueueID='?';";
$stmt = $astdb->prepare($this->q_setQueue);
number of parameters is three so I think the code is correct.
Best How To :
The error you're getting means that the amount of variables you're passing to the
bind_param function isn't matching the amount of placeholders you have in your prepared query.
While you do have 3 variables and 3 "question marks" (keep on reading why I used that term and not "placeholders") in the prepared query - notice that when you're wrapping the suppose to be placeholders with single quotes (
'') they would be treated as real values and not as placeholders.
So basically, you have 0 placeholders and 3 variables -> no match. Removing the single quotes and updating the query:
private $q_setQueue = "update rivr_queues set name=?, description=? where QueueID=?;";
Should solve your problem.