Welcome Guest, Not a member yet? Register   Sign In
Prevent escape functions for Order_by method (DB Active record)
#1

[eluser]C. Jiménez[/eluser]
I'd like to add a tricky, Ugly order_by clause that only works for mysql:
ORDER BY FIELD(specific_order,'XX','ZZ','AA')

Ci by default escape that like this:
ORDER BY FIELD(specific_order, `'XX'`, `'ZZ'`, `'AA')`

And there isn't a parameter to prevent it like on select and where clauses.

My question is:
There is a easy, proper way to fix this behavior?
May be proposed as a new feature for next release?

I'm thinking on override default order_by method of active record class and include a third parameter to prevent escape... or something like that.

Thank you.
#2

[eluser]Bart v B[/eluser]
i did not test it but can you not do something like this?:

Code:
$this->db->order_by(array('XX', 'YY'), FALSE);




Theme © iAndrew 2016 - Forum software by © MyBB