title: Mysql query return multiple columns
body: <p>I want to select and return one value from 5 different columns. I want to </p>
  
  <pre><code>SELECT "BestLoc" from Nutrients WHERE FoodId = '$FoodId' AND CompId = '0000'.
  And again where FoodId = '$FoodId' AND CompId = '0001',
  And again where FoodId = '$FoodId' AND CompId = '0003',
  And again where FoodId = '$FoodId' AND CompId = '0008',
  And again where FoodId = '$FoodId' AND CompId = '0130'.
  </code></pre>
  
  <p>BestLoc is returned 5 times, where FoodId matches the input $FoodId, and the 5 times where CompId matches.</p>
  
  <p>How is that possible to do simple? The best is if the result is returned in </p>
  
  <pre><code>array(
    [0] =&gt; (BestLoc value 1),
    [1] =&gt; (BestLoc value 2) and so on..
  </code></pre>
  
  <h1>Solved like this:</h1>
  
  <pre><code>$stack = array();
  $stmt = $mysqli-&gt;query("SELECT BestLoc from Nutrients WHERE FoodId = '$FoodId' AND CompId IN ('0000', '0001', '0003', '0008', '0130')");
  while($return = $stmt-&gt;fetch_assoc()){
      array_push($stack, $return['BestLoc']);
  }
  </code></pre>