how to echo last_query in codeigniter 4 code example
Example 1: codeigniter print last sql query
print_r($this->db->last_query());
Example 2: codeigniter echo last query
public function test_db(){ $query = $this->db->get("items"); $str = $this->db->last_query(); echo "<pre>"; print_r($str); exit;}