Hi, i have a problem with insert, update and delete with loop. As like… $limit=10; for($i=0;$i<$limit;$i++) { $insertData[$s] = array( '`userid`' = $user_id[$i], ‘`templ_id`’=>$templ_id[$i], ‘`form_label`’=>$form_label[$i], ‘`form_options`’=>$form_options[$i], ‘`form_type`’=> $form_type[$i], ‘`field_order`’=> $field_order[$i], ‘`freq`’=>$freq[$i] ); $this->insert($this->pRfx() .’cus_contact_form’,$insertData); } My problem is every time i m able to insert only one row. and getting error that “Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of elements in type definition string doesn’t match number of bind variables in MysqlDb.php on line 240″. Please help me to fix.
Could you provide the whole class you are using? It would be very helpful to see what $this->insert does.
Yes Bogi, that is my mistake while i was typing here. But still not working. you can check my attached file.
On line #239 of MysqlDB.php after the close brace, put a print_r($args); and tell me what the page outputs.
i would try to help, but it is way to advanced for me to understand. It is telling you that there is a problem in mysqldb.php on line 240. That line is this.. call_user_func_array(array($stmt, 'bind_param'), $args); - from that then it tells you that the vars gave to the call does not match the amount it expected in $stmt var so something is wrong with the $args and the way it is phrased or the stuff you passed to it. The call_user is a valid call, but have to figure why they are miss matched and without really being able to do the output calls that inspect the vars we can go further to debug the script.