Welcome Guest, Not a member yet? Register   Sign In
$this->db->order_by($orderby); trying to escape my $orderby = 'concat(firstname,lastname) asc' make it stop...
#1

[eluser]dmyers[/eluser]
My MySQL order by clause contains

$orderby = 'concat(firstname,lastname) asc'

because I want to sort by the combined first and last names (which works in MySQL) but, when I try to add it with CI active record via $this->db->order_by($orderby) it doesn't work because CI tries to escape it to ORDER BY CONCAT(firstname, `lastname)` asc which of course throws a MySQL error. How can I add it and not have CI try to escape it? Is there a secret "don't escape" parameter?

I suppose a change as such needs to be done in the core files.


Messages In This Thread
$this->db->order_by($orderby); trying to escape my $orderby = 'concat(firstname,lastname) asc' make it stop... - by El Forum - 09-23-2009, 08:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB