Get the last executed Query in Codeigniter

The last executed query can be retrieved in Codeigniter using the function

$lastquery = $this->db->last_query();
echo $lastquery;

This will print the query in the format

/// SELECT * FROM sometable....

Leave a Comment

DON’T MISS OUR GIVEAWAYS!
Subscribe To Newsletter
Subscribe to our newsletter and get all the latest updates offers and giveaways right in your inbox.
Subscribe
Give it a try, you can unsubscribe anytime.
close-link

Join Free Giveaway!

Subscribe to our newsletter to get latest offers and giveaways!
SUBSCRIBE
close-link