title: PHP prepared statement issue
body: <p>I am getting Fatal error: Cannot pass parameter 3 by reference in line# 4
  please suggest me solution I want the binding part dynamic. </p>
  
  <pre><code>$values = array($username,$password);
  $query = "select * from users where email_id = ? and password = ?"
  $this-&gt;con = new mysqli('localhost', 'username', 'password','dbname');
  $stmt = $this-&gt;con-&gt;prepare($query);
  $count = 0;
  for ($i = 0; $i &lt; count($values); $i++) {
      $stmt-&gt;bind_param(++$count,$values[$i], PDO::PARAM_STR,12);
  }
  if ($stmt-&gt;execute()) {
      while ($row = $this-&gt;stmt-&gt;fetch()) {
         $data[] = $row;
      }
      return $data;
  } else {
      return null;
  }
  </code></pre>