微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Codeigniter 错误:未定义的偏移量:1 同时将多个数据插入数据库

如何解决Codeigniter 错误:未定义的偏移量:1 同时将多个数据插入数据库

我正在尝试将多个数据插入数据库但出现错误

This is the error i am getting after submitting the data. 我是 CODEIGNITER 框架的新手,所以不明白为什么会出现此错误

    function savingdata()  

{       

    $this->load->model('Hello_Model');
    $this->load->view('create');
    $this->load->helper('url');
       if((null!==($this->input->post('save')))&& ($this->input->post('save')==true))
            {
                $lr_no = $this->input->post( 'lr_no' );
                $description = $this->input->post( 'description' );
                $Boxes = $this->input->post( 'Boxes' );
                $courier_partner = $this->input->post( 'courier_partner' );
                $actual_wt_kg = $this->input->post( 'actual_wt_kg' );
                $basic_charges = $this->input->post( 'basic_charges' );
                $oda = $this->input->post( 'oda' );
                $amount = $this->input->post( 'amount' );
                $invoice_detail = $this->input->post( 'invoice_detail' );
                $customer_name = $this->input->post( 'customer_name' );
                $place_of_supply = $this->input->post( 'place_of_supply' );
                $payment_info = $this->input->post( 'payment_info' );
                $invoice_id = $this->input->post( 'invoice_id' );
                for($e=0;$e<=count($customer_name);$e++)
                {
                    $data[]=
                [
                  'lr_no'=>$lr_no[$e],'description'=>$description[$e],'Boxes'=>$Boxes[$e],'courier_partner'=>$courier_partner[$e],'actual_wt_kg'=>$actual_wt_kg[$e],'basic_charges'=>$basic_charges[$e],'oda'=>$oda[$e],'amount'=>$amount[$e],'invoice_detail'=>$invoice_detail[$e],'customer_name'=>$customer_name[$e],'place_of_supply'=>$place_of_supply[$e],'payment_info'=>$payment_info[$e],'invoice_id'=>$invoice_id[$e]

                ];
            }   

               
               $this->Hello_Model->saverecords($data);
               
    }
Also I want that when I enter submit button the whole page won't refresh.
**Please help me regarding this.**

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。