Cannot Update Dynamic Fields in Codeignitor |
03-07-2022, 01:12 AM
(This post was last modified: 08-02-2022, 04:29 AM by DennisSSebasiStephen.)
Hi
I created Dynamic fields for billing information,item name,qty,rate,total fields are loaded dynamicall by click Add New.When i want to update active records in dynamic fields there some Database Error. Any For loop issue or anyone suggest public function updatebill(){ $currentBillId=$this->input->post('bill_no'); $update_billno=$this->input->post('itemData[1[bill_no]'); $updatePostData=$this->input->post('itemData'); $this->load->model('billmodel'); $this->billmodel->update_bill_details($currentBillId,$updatePostData); } I have checked $cuurentBillId(having bill Id),$updatePostData(having input fields data which i want to update on the table) public function update_bill_details($currentBillId,$updatePostData){ $bill_no=$this->input->post('itemData[1[bill_no]'); $item_name=$this->input->post('itemData[1][item_name]'); $item_quantity=$this->input->post('itemData[1][item_quantity]'); $item_rate=$this->input->post('itemData[1][item_rate]'); $item_total=$this->input->post('itemData[1][item_total]'); $item_tax=$this->input->post('itemData[1][item_tax]'); $without_tax=$this->input->post('itemData[1][without_tax]'); $item_grand_total=$this->input->post('itemData[1][item_grand_total]'); $item_income_tax=$this->input->post('itemData[1]item_income_tax');`for($i=1;$i<sizeof($updatePostData); $i++)` { $result=array( 'item_name'=>$item_name, 'item_quantity'=>$item_quantity, 'item_rate'=>$item_rate, 'item_total'=>$item_total, 'item_tax'=>$item_tax, 'without_tax'=>$without_tax, 'item_grand_total'=>$item_grand_total, 'item_income_tax'=>$item_income_tax); $this->db->where('bill_no',$i);$this->db-> omegle voojio set($result[$i]); } |
Welcome Guest, Not a member yet? Register Sign In |