summaryrefslogtreecommitdiffstats
path: root/system/database/DB_active_rec.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-05 11:44:36 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-05 11:44:36 +0200
commit97f3697b6c1c220a32d8e63c5da636e9d725dd8a (patch)
tree21f1e6229f5af4f906a114517344c30421786201 /system/database/DB_active_rec.php
parent13e749db5c3cbf2f951347829265c51f8f8ecc34 (diff)
Added a default _insert_batch() method instead of requiring each driver to define it and fixed 2 issues related to it
Diffstat (limited to 'system/database/DB_active_rec.php')
-rw-r--r--system/database/DB_active_rec.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index b324226ab..2bb891309 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -1219,6 +1219,23 @@ abstract class CI_DB_active_record extends CI_DB_driver {
// --------------------------------------------------------------------
/**
+ * Insert_batch statement
+ *
+ * Generates a platform-specific insert string from the supplied data.
+ *
+ * @param string the table name
+ * @param array the insert keys
+ * @param array the insert values
+ * @return string
+ */
+ protected function _insert_batch($table, $keys, $values)
+ {
+ return 'INSERT INTO '.$this->protect_identifiers($table).' ('.implode(', ', $keys).') VALUES '.implode(', ', $values);
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* The "set_insert_batch" function. Allows key/value pairs to be set for batch inserts
*
* @param mixed