CodeIgniter, models, and ORM, how to deal with this?
You probably want something like this:
class Cars { //List all neccessary vars here function __construct() { //get instance of Codeigniter Object and load database library $this->obj =& get_instance(); $this->obj->load->database(); }//You can now list methods like so:function selectCar($name, $color) { $this->obj->db->select('color')->from('car')->where('color', $color); $query = $this->obj->db->get(); switch ($query->num_rows()) { case 0: return false; break; default: return $query->result(); break; } }
Hope that helps!
take a look the the codeigniter wiki page for ORM