title: php bind_result
body: <p>I have this sequence of code:</p>
  
  <pre><code>$connection = new mysqli('localhost','root','','db-name');
  $query = "SELECT * from users where Id = ?"; 
  $stmt = $connection-&gt;prepare($query); 
  $stmt-&gt;bind_param("i",$id); 
  $stmt-&gt;execute();
  $stmt-&gt;bind_result($this-&gt;id,$this-&gt;cols);
  $stmt-&gt;fetch(); 
  $stmt-&gt;close(); 
  $connection-&gt;close();
  </code></pre>
  
  <p>The problem is that the "SELECT" might give a variable number of columns, which i retain in $this->cols. Is there any possibility to use bind_result with a variable number of parameters?...or any alternative to the solution.</p>