[eluser]thomasz[/eluser]
I have a db call using db->select, db->where, db->order_by and finally db->get(table) that for some reason is including a LIMIT 0 in the actual query produced. I have been using CodeIgniter for over 3 years and am currently on the latest version (2.1.0). I have never run into this problem and I'm not sure what is causing it now.
I traced through the code and found that at DB_active_rec line 1792 the code is
Code:
if (is_numeric($this->ar_limit))
In this situation ar_limit had a value of 0. I cannot figure how this was set! To try and fix I perfromed an explicit $db->close() after the prior db call but this didn't help.
Long story short in my model I added this line before db->get:
Code:
$this->db->ar_limit = null;
This fixed the problem. Again, I haven't had to do this anywhere else and the code base is getting pretty big so I'm not sure what was causing it in this particular location. I've worked around here but I'm worried this may be happening in other places that I just haven't found yet.