Welcome Guest, Not a member yet? Register   Sign In
Ways to wrtie in Active Record
#4

Depending on context, I sometimes find it cleaner, especially with long chains, to do something like this:
PHP Code:
$this->db->select('')
 
        ->from('')
 
        ->where('')
 
        ->where_in('')
 
        ->order_by('')
 
        ->limit('');

// Maybe there is more code here to modify the query

// Finally, assign the result to the $my_query variable

$my_query $this->db->get(); 
Reply


Messages In This Thread
Ways to wrtie in Active Record - by Shawn P - 10-23-2014, 01:14 PM
RE: Ways to wrtie in Active Record - by Rufnex - 10-23-2014, 01:35 PM
RE: Ways to wrtie in Active Record - by peterdenk - 10-23-2014, 02:07 PM
RE: Ways to wrtie in Active Record - by mwhitney - 12-12-2014, 01:51 PM
RE: Ways to wrtie in Active Record - by bclinton - 12-12-2014, 05:08 PM
RE: Ways to wrtie in Active Record - by mwhitney - 12-15-2014, 10:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB