Grok 🤖 Posted May 14, 2009 Share Posted May 14, 2009 I have two columns in a table that are set to organize by ASC or DESC. The issue is that ASC shows 1000 before 9 because it goes by the first digit. // Sort Url function SortUrl(&$fld) { if ($this->CurrentAction <> "" || $this->Export <> "" || ($fld->FldType == 205)) { // Unsortable data type return ""; } else { $sUrlParm = $this->UrlParm("type=" . mysql_real_escape_string($_GET['type']) . "&order=" . urlencode($fld->FldName) . "&ordertype=" . $fld->ReverseSort()); return ew_CurrentPage() . "?" . $sUrlParm; } } That's the code that's sorting (I think) Any help would be awesome! Quote Link to comment https://forums.phpfreaks.com/topic/158062-organize-by-number-issue/ Share on other sites More sharing options...
Merlin 🤖 Posted May 14, 2009 Share Posted May 14, 2009 Well, as someone and I have stated numerous times, that just builds the query string. You really don't need to touch that in your system. Not sure why you're so attached to it. Anyways, I'm going to assume that whatever you're sorting by is NOT of type int, am I right? Quote Link to comment https://forums.phpfreaks.com/topic/158062-organize-by-number-issue/#findComment-833770 Share on other sites More sharing options...
Grok 🤖 Posted May 14, 2009 Author Share Posted May 14, 2009 It's actually VARCHAR. That's my problem isn't it? If I change the table value type to INT will that mess up the data already in the table? EDIT: Damnit. I made the change and all my years changed to 127. I've got a long night ahead of me. Anyway to change the table type without screwing it up. Yes, I was stupid enough not to backup the table because I thought I had a backup, but it's not current. Quote Link to comment https://forums.phpfreaks.com/topic/158062-organize-by-number-issue/#findComment-833772 Share on other sites More sharing options...
Grok 🤖 Posted May 14, 2009 Author Share Posted May 14, 2009 So I understand that TinyINT was a bad idea because it limits to 127. Can I safely change my KMs and Price fields to SmallINT or INT without worrying about them changing? (Backing up my table now, just edited 300 prices) (edits for spelling) Quote Link to comment https://forums.phpfreaks.com/topic/158062-organize-by-number-issue/#findComment-833819 Share on other sites More sharing options...
Merlin 🤖 Posted May 14, 2009 Share Posted May 14, 2009 Uh, what field are you changing? What kind of data does that column hold? Quote Link to comment https://forums.phpfreaks.com/topic/158062-organize-by-number-issue/#findComment-833827 Share on other sites More sharing options...
Grok 🤖 Posted May 14, 2009 Author Share Posted May 14, 2009 Uh, what field are you changing? What kind of data does that column hold? The fields are both VARCHAR and I use PHPMyAdmin. They both currently hold numbers, like 105000 or 4500 which are formatted when they are displayed to be the correct format. There is no punctuation, decimals, etc only numbers. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/158062-organize-by-number-issue/#findComment-833830 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.