RE: How to print SQL statement in codeigniter model?
How to print SQL statement in codeigniter model?
$sqlstatement = $this->db->last_query();
There is a new public method
get_compiled_select that can print the query before running
echo $this->db->get_compiled_select(); // before $this->db->get();
Answered on November 12, 2018.
error: Content is protected !!