[ACCEPTED]-Getting raw SQL Queries in CodeIgniter 1.7-codeigniter
Accepted answer
Before the query runs:
$this->db->_compile_select();
And after it has run:
$this->db->last_query();
0
Of course, I found it 2 minutes after posting, courtesy 1 of Phil Sturgeon.
echo $this->db->last_query();
Also, you can put the following in your 2 controller:
$this->output->enable_profiler(TRUE);
You'll get queries and a lot 1 more.
For anyone finding this old post and wondering 2 what this is in the latest v3 the function 1 is $this->db->get_compiled_select().
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.