codeigniter raw query

$query = $this->db->query("YOUR SQL QUERY HERE"); Explanation: - $this->db: Refers to the CodeIgniter database class. - query(): Method used to run a custom SQL query. - "YOUR SQL QUERY HERE": Replace with your custom SQL query enclosed in double quotes.