mysqli - PHP mysqli_stmt::bind_param number of variables does not match -


this question has answer here:

while binding variable prepared statement php reports number of parameters not match !

here code:

private $q_setqueue = "update rivr_queues set name='?', description='?' queueid='?';"; . . . $stmt = $astdb->prepare($this->q_setqueue); $stmt->bind_param('sss',$qname,$qdesc,$qid); 

number of parameters 3 think code correct.

the error you're getting means amount of variables you're passing bind_param function isn't matching amount of placeholders have in prepared query.

while have 3 variables , 3 "question marks" (keep on reading why used term , not "placeholders") in prepared query - notice when you're wrapping suppose placeholders single quotes ('') treated real values , not placeholders.

so basically, have 0 placeholders , 3 variables -> no match. removing single quotes , updating query:

private $q_setqueue = "update rivr_queues set name=?, description=? queueid=?;"; 

should solve problem.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -