I am trying to insert a few rows into the MySQL table using Codeigniter and Active Records.
PHP Code
$data = array(\'......\'); //
For batch uploads you might need something more like:
foreach ($data as $data_item) {
$insert_query = $this->db->insert_string('my_table', $data_item);
$insert_query = str_replace('INSERT INTO', 'INSERT IGNORE INTO', $insert_query);
$this->db->query($insert_query);
}
UPDATE: Use dcostalis's version (in the comments below this one), it will scale much better :-)