CodeIgniter Forums

Full Version: Creating custom 'order_by' string
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]MABUS[/eluser]
Hi,

Is there a way to ORDER BY a specified CASE or IF in CodeIgniter? Right now, I am having to write my entire query in SQL. I'm curious to find out if there is a CI way to do this.

In addition to this, I also want to know if active record class methods is able to handle additional query strings.

El Forum

[eluser]Jilani Jidni[/eluser]
[quote author="MABUS" date="1219746947"]Hi,

Is there a way to ORDER BY a specified CASE or IF in CodeIgniter? Right now, I am having to write my entire query in SQL. I'm curious to find out if there is a CI way to do this.

In addition to this, I also want to know if active record class methods is able to handle additional query strings.[/quote]

Please read the active record manual and hope you will get your solution

http://ellislab.com/codeigniter/user-gui...ecord.html

El Forum

[eluser]newsun[/eluser]
While reading the above mentioned TOC section look for this part:
Code:
$this->db->order_by();