CodeIgniter Forums
set_insert_batch, set_update_batch - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: set_insert_batch, set_update_batch (/showthread.php?tid=66772)



set_insert_batch, set_update_batch - sneakyimp - 11-30-2016

I am puzzled by the methods set_insert_batch and set_update_batch described in the docs.

What do they do? They don't allow one to specify a table and their parameters look unlike anything for insert_batch or update_batch. Can someone show me an example?

I'm also curious how to use update_batch -- how is the update logic determined if one just provides a bunch of arrays? Is it somehow aware of the primary key? What if the table has no primary key? What if you have twenty records with 10 columns each and these records each differ by only one column?