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 Link to comment https://forums.phpfreaks.com/topic/151939-solved-mysqli-bind_param-with-array/ 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 Link to comment https://forums.phpfreaks.com/topic/151939-solved-mysqli-bind_param-with-array/#findComment-797936 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.