If you do not use AR, you can do this: INSERTINTOTABLE (FIELDS) VALUES ('1', '2'), ('3', '4 '); $ this-& amp; gt; db-& amp; gt; query ($ sq
If you do not use AR, you can do this:
Insert into table (FIELDS) VALUES ('1', '2'), ('3', '4 ');
$ This-> db-> query ($ SQL );
I personally like the AR operation of CI. in the old version (about 2.0), there should be no operation to insert multiple data entries. The new version can be used:
$ This-> db-> insert_batch ();
Example:
$ Data = array ('name' => 'php point pass', 'URL' => 'http: // www.phpddt.com '), array ('name' => 'resume home', 'URL' => 'http: // www.52jianli.com '); $ this-> db-> insert_batch ('mytable ', $ data );
The preceding SQL statement is as follows: INSERT INTO mytable (name, url) VALUES ('php point pass', 'http: // www.phpddt.com '), ('resume home ', 'http: // www.52jianli.com ')