CodeIgniter Forums

Full Version: How to extract the query from db object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]fatman[/eluser]
Hi,
I'm building a conditions screen where the user can build sql via GUI.

After the user is done he will press on the test button and i'll build a query dynamically and

test it using
Code:
$this->db->query($query,$data)
.

I also want to save the actual query after it has been verified (with the actual values instead of the question marks), is there a way to get it?

Thanks.

El Forum

[eluser]Bart Mebane[/eluser]
Code:
$sql = $this->db->last_query();