last query in ci

How to get last executed query in PHP Codeigniter?

Example:

public function AddMethodNameHere()
{
    $executeQQ = $this->db->get("your_table_name");
  
    $results = $this->db->last_query();
   
    echo "<pre>";
    dump($results);
    exit;
}

Final Results:

SELECT * FROM `your_table_name`