Develop #612

wants to merge 2 commits into


None yet

5 participants


Currently CodeIgniter does not have way to see query built my active record. For example in ZF you can echo out SQL made by Zend Select. So, I wrote similar thing for CI.


CodeIgniter does include $this->db->last_query(); which will show you the query.


As far I know $this->db->last_query(); only shows latest query that was fired. My modification shows query that was prepared by active record before query execution. For more information please visit


That only shows the last executed query. This gives you the potential to view/dump query as you are building it.

Seems like a neat little query, though it'd probably be better if it were renamed to something like current_querry() instead of overriding the __toString() method of the class


this has already been added


@derekjones derekjones closed this Oct 31, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment