CodeIgniter Forums
problem with active record - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: problem with active record (/thread-45647.html)

problem with active record - El Forum - 09-29-2011

I'm using active records in all retrieve data from database, but some queries I do with active record has troubles, generally don't bring the last record...

for example

I have 5 records in my database with this idCategory

I have this query by active record

$query = $this->db->get('news',10,$offset);
$data['news'] = $query->result();

That should generate this sql below

SELECT * FROM news WHERE idCategory = 1 and status = 1 order by dateHour desc

BUT, when a call the controller that has this query(active record), it bring to me only 4 records(don't bring me the last)

AND when I execute the sql normal in the database, bring me exactly what I want, the 5 records