December 2013
Intermediate to advanced
306 pages
6h 26m
English
Sometimes, it is useful to know about the last query that was run against the database, either for debugging purposes or for reasons where you wish to have an audit trail of every interaction with the database—you'll be surprised at the number of times you'll need to do this. CodeIgniter comes with a really handy function that you can use to write out the most recent query that CodeIgniter sent to the database.
$this->db->last_query();
Quite simply, this function will return the last query to be sent to the database; you can place it in the controller or model (even the view if you wish, but it's better to keep it at ...
Read now
Unlock full access