[eluser]xarazar[/eluser]
Hi guys,
I'm pretty sure I'm doing something incredibly daft here but after having spent a few hours I still can't find an answer.
I just started with CI2 and the first thing that stopped me and my drags was something I completely didn't expect: I can't force $this->db->where() to work.
The function is laughably simple:
Code:
function get_page($url = 'home'){
$this->db->where('url', $url);
$q = $this->db->get('content');
//$q = $this->db->query('SELECT * FROM content WHERE url = ?', $url);
if($q->num_rows() == 1) return $q->row(); else return FALSE;
}
So... a unique url is passed on and I expect to receive only one result. Nope. The function works as if there was no WHERE clause at all!
The commented line is the one I use right now to actually get the expected result.
So what am I missing? Anybody experienced that?
Many thanks.