There is a new public method get_compiled_select that can print the query before running it. echo $this->db->get_compiled_select(); // before $this->db->get();
You need to use $this->email->clear(); to clean out the variables set within the loop. At the end of the loop add: $this->email->clear(TRUE); This resets all email variables including the attachments, allowing you to create a new mail.
click on wamp icon -> MySql -> MySql Setting -> sql-mode -> user_mode