Ayon Posted March 31, 2009 Share Posted March 31, 2009 baisicly i'm building the where part of the query up from an array... i pass trough the prepare() perfectly but then i get stuck... this is what i've got now.. never thought it would work but had to try it $marker = $stmt->param_count; $type=null; $values=null; for($i=0;$i<$marker;$i++) { $type .= $stmt_bind['type'][$i]; $values .= $stmt_bind['value'][$i]; if ($i<$marker-1) { $values .= ', '; } } $stmt->bind_param($type, $values); The error i expected to get and got Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of elements in type definition string doesn't match number of bind variables in C:\wamp\www\framework\pel_lib\classes\mysql.class.php on line 77 Is there a way to solve this and still be using the array setup i've got? I've checked all values and they return the right values... Thanks in advance Quote Link to comment Share on other sites More sharing options...
Ayon Posted March 31, 2009 Author Share Posted March 31, 2009 cant belive how easy it was!! this i what helped me http://no2.php.net/manual/en/mysqli-stmt.bind-param.php#89171 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.