[eluser]TheFuzzy0ne[/eluser]
I'm guessing you are getting an error, but you can't see it as you've turned down the error reporting level. Can you confirm that this isn't the case?
I've tidied up your code a little. It may not make any difference, but it only took a few seconds, so I figured I should do it:
Code:
function copy_events_for_template($meet_id, $template_id, $host_id)
{
$this->db->where('meet_id', $meet_id);
$events = $this->db->get('meet_events');
foreach ($events->result_array() as $event)
{
$data['event_id'] = $event['event_id'];
$data['gender'] = $event['gender'];
$data['template_id'] = $template_id;
$this->db->insert('meet_template_events', $data); // I think this line might be inserting over a row where the ID exists
}
}