title: Php multiple variables into one
body: <p>So Ive got a couple of statements using a list of variables and it seems i am always adding another column to the database so i wanted to make one list of variables and contain it somehow so i can just change it once if i need to instead of half a dozen times.</p>
  
  <pre><code>    $stmt = $mysql-&gt;prepare("SELECT * FROM table WHERE id =? LIMIT 1");
  
  $stmt -&gt; bind_param('i', $id);
  
  $stmt-&gt;execute();
  
  $stmt-&gt;bind_result($a, $b, $c, $d, $e, $f, $g);
  
  $stmt-&gt;fetch();
  
  $stmt-&gt;close(); 
  </code></pre>
  
  <p>But I want to make something like this:</p>
  
  <pre><code>    varList="$a, $b, $c, $d, $e, $f, $g";
  
      $stmt = $mysql-&gt;prepare("SELECT * FROM table WHERE id =? LIMIT 1");
  
  $stmt -&gt; bind_param('i', $id);
  
  $stmt-&gt;execute();
  
  $stmt-&gt;bind_result($varList);
  
  $stmt-&gt;fetch();
  
  $stmt-&gt;close(); 
  </code></pre>