Welcome Guest, Not a member yet? Register   Sign In
How can you retrieve the sql statement built from active record?
#1

[eluser]MyDarkPassenger[/eluser]
I'm using active record to build a sql statement but I'm not retrieving the results correctly. I'd like to see the sql that is being generated. I didn't see anything in the guide but maybe I missed it. Thank you for any help!
#2

[eluser]Dam1an[/eluser]
The easiest way is to enable the profiler which will show all queries as well as benchmarks, post data etc
Code:
$this->output->enable_profiler(true);
#3

[eluser]n0xie[/eluser]
Just output this after the query you want to see:
Code:
echo $this->db->last_query();
#4

[eluser]MyDarkPassenger[/eluser]
Thank you that helps!




Theme © iAndrew 2016 - Forum software by © MyBB