title: call bind_param using call_user_func_array mysqli prepared statement
body: <p>I have a function that can take any number of parameters like below:</p>
  
  <pre><code>public function executePreparedStatement($query, $paramString = ''){
      $stmt = $this-&gt;db-&gt;prepare($query);
      if (func_num_args() &gt; 2){
          $parameters = func_get_args();
          array_shift($parameters); // Get rid of the query
          $parameters = array('s', 'email@email.com');  //Hard code for test
          call_user_func_array(array($stmt, "bind_param"), $parameters);
          // $stmt-&gt;bind_param($parameters[0], $parameters[1]); //Hard code for test
      }
      $stmt-&gt;execute();
      $this-&gt;result = $stmt-&gt;get_result();
      $stmt-&gt;close();
  }
  </code></pre>
  
  <p>The problem is when I run the code as is, The stmt object displays:</p>
  
  <pre><code>No data supplied for parameters in prepared statement
  </code></pre>
  
  <p>But when I comment out the <code>call_user_func_array</code> call and uncomment the subsequent line, the query works.  </p>