View Single Post
Old 04-30-2009, 04:51 PM  
ProG
Confirmed User
 
Join Date: Apr 2009
Posts: 1,319
Quote:
Originally Posted by Jakez View Post
That was their first suggestion, didn't work :/
That should have worked. Are you sure the 'views' field is set to an integer type?

Quote:
Originally Posted by Jakez View Post
Even tried: SELECT * FROM `table`, DATE_FORMAT(`time`, '%M %e %Y') as formatTime ORDER BY `formatTime` DESC,`views` DESC
This query looks invalid. It should be something more like this:

Code:
SELECT *, DATE_FORMAT(`time`, '%M %e %Y') as `formatTime` FROM `table` ORDER BY `formatTime` DESC, `views` DESC
Quote:
Originally Posted by Jakez View Post
Maybe I could just sort everything by views, and then as it's looping through throw each post into the group which date it belongs to..?
I think ultimately you will want to create an array for ease of outputting the data. If you only sort by views, then build the array, you will still need to sort by date (which is much easier to do with mysql).
ProG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote