[eluser]xarazar[/eluser]
Just to clarify this is the exact setup of my app:
Code:
class Site extends CI_Controller{
function index(){
$this->output->enable_profiler(TRUE);
$q = $this->db->where('url', 'home');
$q = $this->db->get('content');
print_r($q->result());
}
}
The above works as expected, prints out one record from the database, the profiler shows the executed query.
When I change the setup to:
Code:
class Site extends CI_Controller{
function index(){
$this->output->enable_profiler(TRUE);
print_r($this->site_model->get_page('home'));
}
}
class Site_model extends CI_Model{
function get_page($url = 'home'){
$q = $this->db->where('url', $url);
$q = $this->db->get('content');
return $q->result();
}
}
The script prints out all the records from the table = the WHERE clause doesn't work.
When I modify my model to use get_where like this:
Code:
class Site_model extends CI_Model{
function get_page($url = 'home'){
$q = $this->db->get_where('content', array('url' => $url));
return $q->result();
}
}
everything seems to be working fine.
I'm this close to going back to CI 1.7.3 so any help or suggestions will be greatly appreciated.