You can use this:
$this->db->last_query();
“Returns the last query that was run (the query string, not the result).”
Reff: https://www.codeigniter.com/userguide3/database/helpers.html
More Related Contents:
- CodeIgniter MSSQL connection
- How to execute my SQL query in CodeIgniter
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE `id` [closed]
- how to get client’s IP address in sql database [closed]
- Combine multiple sql / mysql queries in one query
- Parse error: parse error, expecting `'{” in [closed]
- Cleansing User Passwords
- CodeIgniter removing index.php from url
- Remove index.php From URL – Codeigniter 2
- Simple PHP Pagination script [closed]
- CodeIgniter PHP Framework – Need to get query string
- How to add an ORDER BY clause using CodeIgniter’s Active Record methods?
- How can I Use Prepared Statements in CodeIgniter
- How do I check if the request is made via AJAX in CodeIgniter?
- Codeigniter – Using Multiple Databases
- How to create Codeigniter language files from database?
- How to get data in function extend controller?
- Fatal error: Uncaught exception ‘mysqli_sql_exception’ with message ‘No index used in query/prepared statement’
- How to generate unique id in MySQL?
- Upload multiple files in CodeIgniter
- Codeigniter session data lost after redirect
- How to select rows where column value IS NOT NULL using CodeIgniter’s ActiveRecord?
- Codeigniter CSRF valid for only one time ajax request
- I’m getting this error code: Invalid argument supplied for foreach() [duplicate]
- Role Based Access Control
- How can I redirect a 404 Error in a custom 404 page using Codeigniter?
- Php & Sql Injection – UTF8 POC
- Escaping SQL queries in Codeigniter
- Aggregated query without GROUP BY
- Sending XML data using HTTP POST with PHP