Welcome Guest, Not a member yet? Register   Sign In
How to Echo Active Record Query?
#1

[eluser]fiddle-sticks[/eluser]
Hi, I would like to know if it is possible to echo the query that active record generates automatically behind the scenes.
For example when saying WHERE etc I would like to print out the string that it has generated for debugging purposes.
Is this possible?
Thanks in advance
#2

[eluser]kreamik[/eluser]
i think for debugging mode CI provide active record that is $this->db->last_query(),

but it seems we cannot partially debug on the sql query because the last query generated after CRUD operation ( i think .. )

but if you really want to know you can print that object ( $this->db ) to see what properties has been add to the query ..

you can print it to log files too
#3

[eluser]fiddle-sticks[/eluser]
Awesome thanks




Theme © iAndrew 2016 - Forum software by © MyBB