eevan79 Posted August 1, 2010 Share Posted August 1, 2010 This sorting goes me crazy . Ok, here is script: $result = mysql_query("SELECT * FROM " . $table_prefix . "users ORDER BY ".$sort." ".$ascdesc." LIMIT $offset, $users_per_page"); $sort is "user_name". And I get following results: First I get user starting with "K" than "a", "b" etc. It looks like this: 1. Korisnik 2. asdsa 3. test1 4. test2 etc... Why I get wrong sorting by username? Other sortings work fine (date, last login etc.) Link to comment https://forums.phpfreaks.com/topic/209486-sorting-from-mysql-bug/ Share on other sites More sharing options...
Mchl Posted August 1, 2010 Share Posted August 1, 2010 Most likely you have a case sensitive collation set up for user_name column. Change to case insensitive and you should be fine. Link to comment https://forums.phpfreaks.com/topic/209486-sorting-from-mysql-bug/#findComment-1093800 Share on other sites More sharing options...
eevan79 Posted August 1, 2010 Author Share Posted August 1, 2010 Thats it 100%. I totally forgot. Thanks. Link to comment https://forums.phpfreaks.com/topic/209486-sorting-from-mysql-bug/#findComment-1093801 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.