title: "Order by" clause doesn't work in MySQL query run by Node.js
body: <p>I have the following query, which works correctly in PHP:</p>
  
  <pre><code>SELECT g.*
       , u.username 
    FROM games g
    JOIN users u
      ON g.admin_id = u.id 
   WHERE g.status &lt; 4 
   ORDER 
      BY g.status DESC
       , g.start_date DESC;
  </code></pre>
  
  <p>It returns the rows and orders them correctly by <code>status desc</code> and then <code>start_date desc</code>.</p>
  
  <p>However, when I try to run the same query from Node.js, it still returns all the rows, but not in the correct order. It seems it orders them by ID, which means it disregards the <code>order by</code> clause above. Why is that and how do I fix it? Here is the code:</p>
  
  <pre><code>connection.query("    
  SELECT g.*
       , u.username 
    FROM games g
    JOIN users u
      ON g.admin_id = u.id 
   WHERE g.status &lt; 4 
   ORDER 
      BY g.status DESC
       , g.start_date DESC;
  ", function(err, rows, fields) {
          rows.forEach(function(row) {
              //work with each row
          });
      });
  </code></pre>
  
  <p>EDIT: I'm using the <a href="https://npmjs.org/package/mysql" rel="nofollow"><code>mysql</code> package</a> to connect to MySQL.</p>