Triggers creation are just not working, I tried everything I can think of, for instance, like that:
$this->db->query(\"DELIMITER //\\r\\n
CREATE TRIGGE
You should remove the delimiter from the trigger while executing via PHP. mysql_ or mysqli_ functions should be able to execute the trigger without the delimiter.
Here is how to do it.
$this->db->query("
CREATE TRIGGER `delete_post` BEFORE DELETE ON `posts`\r\n
FOR EACH ROW BEGIN\r\n
DELETE FROM page_content WHERE page_content.post_id = OLD.post_id;\r\n
END\r\n
//\r\n
");