Jump to content

Problem with Mysqli and bind_param


amirelgohary1990

Recommended Posts

On 9/20/2009 at 7:22 AM, corbin said:

Hrmmmmm odd.  I just looked on the manual page for call_user_func_array and for some reason it appears that the array is passed by value.  Usually things are passed by value, but they're references until it is edited.

 

 

This is a ghetto hacked suggested by someone:

 

 

        $params = array('ss', 'stan', 'Stanley');

        $tmp = array();

        foreach($params as $key => $value) $tmp[$key] = &$params[$key];

        call_user_func_array(array($stmt, 'bind_param'), $tmp);

Hello

Just I am trying to replace  $params = array('ss', 'stan', 'Stanley'); 

With 
$arr = [1,2,5];
$params = array('ss', 'stan', $arr);

But when I do that gives me error Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.