title: Custom MySQL Ordering
body: <p>I have a query that needs a custom sorting, trimmed down to the bare minimums something like:</p>
  
  <pre><code>SELECT u.*, p.*, p.id as product_id
  FROM users u, products p 
  WHERE u.id = p.user_id
  ORDER BY product_id DESC
  </code></pre>
  
  <p>And I get returned a set of rows like:</p>
  
  <pre><code>UserID        ProductID
       2                5
       2                4
       3                3
       1                2
       1                1
  </code></pre>
  
  <p>But I want it to actually sort SOMETHING like this (so no 2 UserIDs are adjacent to eachother):</p>
  
  <pre><code> UserID        ProductID
       1                2
       2                4
       3                3
       2                5
       1                1
  </code></pre>
  
  <p>Is this even possible with MySQL, or do I need some PHP magic?</p>