Insert Bidimensional Array Into database |
[eluser]Juan Velandia[/eluser]
Hello everyone, I have this array created into a controller Code: Array And in need to insert it into a table with an sql sentence like this: Code: insert into requisito_tramite (id_requisito, id_tramite) Values (1,1); I would like to pass the array data to a model and make it work, but I dont seem to get it. Could you please give an Idea or point me to a previous tread?. Thanks in advance
[eluser]egy_programozo[/eluser]
Hope this is what you wanted Code: class Requisito_tramite extends CI_Model {
[eluser]CroNiX[/eluser]
That is very wasteful. You can do this in a single query using insert_batch(). Code: $this->db->insert_batch('tablename', $your_array_from_above);
[eluser]Juan Velandia[/eluser]
Thanks to both of you. The insert_batch() worked like a charm. Thanks a lot! |
Welcome Guest, Not a member yet? Register Sign In |