Multiple save :( - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18) +--- Thread: Multiple save :( (/showthread.php?tid=895) |
Multiple save :( - bobykurniawan - 01-26-2015 Goodday, please check my script first. I'll explain later. PHP Code: function detailsave($idshipping = NULL) RE: Multiple save :( - Rufnex - 01-27-2015 You have to fill your array properly : PHP Code: $data[] = array( .... RE: Multiple save :( - sv3tli0 - 01-27-2015 Lets say you have 3 possible problems.. 1st as Rufnex said at the foreach you must store: PHP Code: $data[] = array (......); This way you will have Array of arrays , at the moment you have just 1lvl array which is not valid for multiple inserts... 2nd is that you are using $_POST while CodeIgniter provides you with a $this->input->post method which is secured for manipulating input data.. 3rd you must be ready for the case where the post is empty... else you can try to insert empty $data ... |