Here’s the error generated by the above code:
Error Number: 1052
Column ‘group_id’ in where clause is ambiguous
SELECT `template_name`, `template_data`, `template_type`, `template_notes`, `cache`, `refresh`, `no_auth_bounce`, `allow_php`, `php_parse_location`, `template_id`, `template_name`, `group_name` FROM (`exp_templates`) JOIN `exp_template_groups` ON `exp_templates`.`group_id` = `exp_template_groups`.`group_id` WHERE `exp_templates`.`site_id` = 1 AND `group_id` = 16 ORDER BY `group_name`, `template_name`
Filename: C:\wamp\www\system\codeigniter\system\database\DB_driver.php