Codeigniter Display Last Query

2:03 PM

The following code return the last query that was running in codeigniter.
Sometimes we want to display which query was currently running. For this purpose just echo
the query then it will display the last query that was run.


<!-- Codeigniter last Query -->
   <?php 
    $last_query = $this->db->last_query();
    ?>
<!-- It will produce: SELECT * FROM table WHERE.... -->

I am Web Developer and Web Designer. Also Part Time Blogger. Love To Code in HTML, CSS, JS, jQuery, Bootstrap, PHP, WordPress, Magento.

RELATED POSTS

First