title: Reverse order of SQL query output
body: <p>I have a bit of a problem that I cannot solve. I am running the following through my database using PHP:</p>
  <pre><code>$strQuery = &quot;select * from LastResult ORDER BY Date DESC LIMIT 10&quot;;
  </code></pre>
  <p>The results all come back fine and as expected. However, I then have to feed these into a line chart, but when I do so, they are obviously displayed in reverse as I have the DB to return them in DESC by Date which means the most recent will be the first returned.</p>
  <p>Is there a way that after returning these results I can reverse their order before feeding the data to my chart?</p>
  <p>Here is the full query (please don't comment about the use of <em>mysql</em> instead of <em>mysqli</em>; I didn't write that bit)</p>
  <pre><code>$strQuery = &quot;select * from LastResult ORDER BY Date DESC LIMIT 10&quot;;
  
  $result3 = mysql_query($strQuery) or die(mysql_error());
  
  if ($result3) {
      while($ors4 = mysql_fetch_array($result3)) {
          $NumberResults2 = $ors4['Date'];
  
          $strQuery = &quot;select AvGoalDifference as Average from LastResult where Date= '$NumberResults2'&quot;;
  
          $result4 = mysql_query($strQuery) or die(mysql_error());
          $ors3 = mysql_fetch_array($result4);
  
          $strXML .= &quot;&lt;set label='&quot; . $NumberResults2 . &quot;' value='&quot; . $ors3['Average'] . &quot;' /&gt;&quot;;
  
          mysql_free_result($result4);
      }
  }
  
  mysql_close($link);
  
  $strXML .= &quot;&lt;/chart&gt;&quot;;
  $chart2 = renderChart(&quot;charts/Line.swf&quot;, &quot;&quot;, $strXML, &quot;AverageGD&quot;, 500, 260, false, true, true);
  
  echo $chart2;
  </code></pre>