title: How to iterate by row through a mysql query in php
body: <p>Ok, So I am trying to query my database and select all rows that have a certain value.
  After that I turn the query into an array with mysql_fetch_array(), then I tried iterating by row through the fetched array using a for each loop.</p>
  
  <pre><code>&lt;?php
  $query = mysql_query("SELECT * FROM users WHERE pointsAvailable &gt; 0 ORDER BY pointsAvailable Desc");
  $queryResultArray = mysql_fetch_array($query);
  foreach($queryResultArray as $row)
  {
      echo $row['pointsAvailable'];
  }
  ?&gt;
  </code></pre>
  
  <p>Though when I do this for any column besides the pointsAvailable column say a column named "name" of type text it only returns a single letter.</p>
  
  <p>How do I iterate through a returned query row by row, and be allowed to fetch specific columns of data from the current row?</p>