I had an issue when I tried to add mysql trigger query via codeigniter $this->db->query();
but it shows syntax error. Here is code below:
$this->db->query("DELIMITER $$
CREATE TRIGGER `after_stuload_insert_info_data` AFTER INSERT
ON `{$this->tables->hesa_stuload_student_info}`
FOR EACH ROW BEGIN
INSERT INTO `{$this->tables->hesa_student_reportperiod}` (hesa_course_relation_instance_id, student_data_id)
VALUES (new.hesa_course_relation_instance_id, new.student_data_id);
END$$
DELIMITER ; ");
Can you Please tell what is the wrong with this code. Thanks in advance. Check below for the error.