I would like to execute multiple insert queries simultaneously using codeignitor framework in PHP.There is any simple ways to do this without writing multiple insert queries.Already tried something like $this->db->query('INSERT INTO students (first_name, last_name) VALUES ('teejay', 'obazee')' ('maev', 'shadowsong')' ('jaina', 'proudmore')', FALSE) .There is any ways like this.Which is not working.If anybody knows;please help me.
+1
A:
Unfortunately, you need to do something like:
$this->db->query("INSERT INTO `students` (`first_name`,`last_name`) VALUES ('teejay', 'obazee'),('maev', 'shadowsong'),('jaina', 'proudmore')");
Or use someone else's class to build the query: http://codefury.net/2009/12/insert-multiple-rows-into-a-database-with-codeigniter/
Billiam
2010-04-09 15:16:34