strago Posted November 19, 2012 Share Posted November 19, 2012 $query = "SELECT id, title, seo, source, counter {$FROM} ORDER by `counter` DESC LIMIT {$limit}, {$records_per_page}"; spits it out like this... 2 2 14 12 1 1 How do you make it show up as 14 12 2 2 1 1 Quote Link to comment Share on other sites More sharing options...
trq Posted November 19, 2012 Share Posted November 19, 2012 What data type is the counter field? Quote Link to comment Share on other sites More sharing options...
strago Posted November 19, 2012 Author Share Posted November 19, 2012 `counter` varchar(256) collate utf8_unicode_ci NOT NULL default '0', I just tried changing it from ORDER by `counter` DESC to ORDER by counter + 0 DESC and that made it start sorting correctly. Quote Link to comment Share on other sites More sharing options...
Psycho Posted November 19, 2012 Share Posted November 19, 2012 That makes a lot more sense than changing the counter field to a number type. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.