I'm developing a mailing queue in Codeigniter that sends 100 messages at a time. I'm searching for the best way to do this and came across $this->db->insert_batch()
. It looks useful but I can't find information on when or how to use it. Has anyone used it for mailing purposes?
$data = array(
array(
'title' => 'My title' ,
'name' => 'My Name' ,
'date' => 'My date'
),
array(
'title' => 'Another title' ,
'name' => 'Another Name' ,
'date' => 'Another date'
)
);
$this->db->insert_batch('mytable', $data);
// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date')