title: Why does Mysql query only give me the last result of a query instead of all results?
body: <p>getting values</p>
  
  <pre><code>session_start();
  $text = $_SESSION['text']; (it's an array with multiple values)
  </code></pre>
  
  <p>making the array suitable for the query</p>
  
  <pre><code>$text = array_filter($text);
  $text = implode("','", $text);
  $text = "'".$text."'";
  </code></pre>
  
  <p>run query</p>
  
  <pre><code>$sql = "SELECT id_category FROM eiofm_category_lang WHERE name IN (".$text.")";
  $query = mysql_query($sql);
  </code></pre>
  
  <p>get query result</p>
  
  <pre><code>while($result = mysql_fetch_array($query))
  {
      var_dump($result);
  }
  </code></pre>
  
  <p>EDIT</p>
  
  <p>I got it working with a foreach loop but still don't know why the while loop didn't work.</p>