Jump to content

Having issues with my Order By

Jim R

Recommended Posts

Here is the query:

$query = 'SELECT * FROM a_playerRank WHERE year="2015" and position="1" and grouping<4 ORDER BY grouping DESC,rankPos,region,nameLast';

I have three groups (grouping).  

The first group is based on their ranking 1-10 or 1-15.  (working fine)

The second group is supposed to be alphabetical based on last name.  (not working)

The third group is supposed to be based on region, then alphabetically by their last name, and I have a header for each region. (working fine)


I attached an image of grouping two and three.  Group two (top group in the picture) isn't alphabetical.  


I know why the query isn't producing what I want, but I can't figure out the query I need to get my list to show as I described it.  It shows the second group ordered by region then last name, just without headers.  When I flip region and nameLast in the order by, the second group works great, but the third group basically produces a header for each kid (it looks like a mess).


I assume there is a more complex query that will produce what I want.  




Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.