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....

Related Posts

Leave a Comment

Share via
Copy link
We would like to show you notifications for the latest offers and updates.
Dismiss
Allow Notifications