for example, i want to convert this;
$this->db->get('table');
to this;
'SELECT * FROM table'
is there any function for this? i searched on the user guide of CI but didnt find any solution.
You can also use $this->db->get_compiled_select(). The difference between get_compiled_select() and last_query() is that get_compiled_select() gives the query string generated even if you don't run the query against the database.
_compile_select(), that you have to use $this->db->_reset_select(); after executing the query. If you don't, CodeIgniter won't clear the query, and all queries onward won't work._compile_select() is not working anymore because they protected the function at the latest CI2 Github repo. I used this function so many times and now I'm stuck. Maybe there is a solution?get_compiled_select(). codeigniter.com/nightly_user_guide/database/…get_compiled_select() will be available with codeigniter-3 codeigniter.com/userguide3/database/query_builder.html codeigniter.com/userguide3/changelog.html