Welcome Guest, Not a member yet? Register   Sign In
Fatal Error after creating second function
#2

[eluser]xzela[/eluser]
Hi,

You can use the Active Record feature by doing this:
Code:
$this->db->from('available');
$this->db->where('visible', 1);
$query = $this->db->get();

if($query->num_rows() > 0) {
return $query->results();
}
else {
return null; //found nothing;
}

It may look like more code, but it's much easier to read. Plus if you ever wanted to expand it at a later date, doing so will not result in an entire rewrite of the query. You can easily plug in extra joins and where clause


Messages In This Thread
Fatal Error after creating second function - by El Forum - 01-28-2009, 12:08 PM
Fatal Error after creating second function - by El Forum - 01-28-2009, 12:14 PM
Fatal Error after creating second function - by El Forum - 01-28-2009, 12:19 PM
Fatal Error after creating second function - by El Forum - 01-28-2009, 12:24 PM
Fatal Error after creating second function - by El Forum - 01-28-2009, 12:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB