• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating custom 'order_by' string

#1
[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.

#2
[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

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.