Reputation: 20
I got some problem in code igniter . I just want to know which query going to execute in model. I knew about last query execution using $this->db->last_query();
Since, I doesn't want this there are multiple queries execution so, I am not able to identify exact query . so , i want to know which query will generate in code igniter before it could execute.
Upvotes: 0
Views: 56
Reputation: 743
Add this line in your controller:
$this->output->enable_profiler(TRUE);
Doing this you can see all the queries executed at the bottom of your pages.
Upvotes: 1
Reputation: 2741
you can check all the queries by adding $this->output->enable_profiler(TRUE);
in your controller constructor or in your model function. When you will run it will show all the queries on that page.
Upvotes: 0
Reputation: 18601
Try this
$str = $this->db->last_query();
echo $str; //// Produces: SELECT * FROM sometable....
Upvotes: 0