diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index e34b2a22..6ef7d96e 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -517,12 +517,37 @@

$this->db->insert();



// Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date') -

The first parameter will contain the table name, the second is an associative array of values.

-

Note: All values are escaped automatically producing safer queries.

+

$this->db->insert_batch();

+

Generates an insert string based on the data you supply, and runs the query. You can pass a +multidimensional array to the function:

+ + +$data = array(
+   array(
+      'title' => 'My title' ,
+      'name' => 'My Name' ,
+      'date' => 'My date'
+   ),
+   array(
+      'title' => 'Another title' ,
+      'name' => 'Another Name' ,
+      'date' => 'Another date'
+   )
+);
+
+$this->db->update_batch('mytable', $data); +

+// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date')
+ +

The first parameter will contain the table name, the second is a multidimensional associative array of values.

+ +

Note: All values are escaped automatically producing safer queries.

+ +

$this->db->set();

This function enables you to set values for inserts or updates.