Jump to content

Organize by Number Issue


gamerzfuse

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/158062-organize-by-number-issue/
Share on other sites

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.

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!

Archived

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.