pass query in ci code example Example: raw query in codeigniter $query = $db->query('YOUR QUERY HERE');