[SOLVED] can't save transaction without details |
[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1266228457"]no, as I was saying, it is the code that is allowing it to work. You take it out and you will have to alter some other things to get your site to function again. I was just letting Xeroblast know the part of the code that is setting the $postConfig element.[/quote] yes, i know the switch is working thanks for explaining. EDIT: @xeroblast this line of code is my problem: Code: $item = $this->input->post("item");
[eluser]theprodigy[/eluser]
Quote:That explanation was for Xeroblast. He had commented about it, so I was explaining it to him.Quote: theprodigy - 14 February 2010 11:07 PM
[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1266231582"] Quote:That explanation was for Xeroblast. He had commented about it, so I was explaining it to him.[/quote]Quote: theprodigy - 14 February 2010 11:07 PM @theprodigy, yes, now i understand. i know you were explaining it to him. thanks for the effort.
[eluser]xeroblast[/eluser]
try to view the data that will be save into the dbase before the $this->db->insert()... using var_dump() or print_r()...
[eluser]maria clara[/eluser]
[quote author="xeroblast" date="1266242201"]try to view the data that will be save into the dbase before the $this->db->insert()... using var_dump() or print_r()...[/quote] when i initialize the variable $item to 1 or 2. it posts the data i added in the detail grid. with this code: Code: case $crudConfig['create']:
[eluser]xeroblast[/eluser]
could you put the print_r() here: function save_detail($id,$rows) //Query for saving the company details { $this->db->where('user_id', $id); $this->db->delete('sec_companyaccess'); foreach ($rows as $row) { $rdata = explode('|', $row); $data['user_id'] = $id; $data['company_id'] = $rdata[3]; // print_r($data); $this->db->insert('sec_companyaccess', $data); } }
[eluser]maria clara[/eluser]
[quote author="xeroblast" date="1266311338"]could you put the print_r() here: function save_detail($id,$rows) //Query for saving the company details { $this->db->where('user_id', $id); $this->db->delete('sec_companyaccess'); foreach ($rows as $row) { $rdata = explode('|', $row); $data['user_id'] = $id; $data['company_id'] = $rdata[3]; // print_r($data); $this->db->insert('sec_companyaccess', $data); } }[/quote] im not using that function anymore because it is for the flexigrid. i changed the flexigrid to jqgrid. and here's the function im using now: Code: function save_companydetail($details,$id) it is adding now when i initialize $item=2;.
[eluser]xeroblast[/eluser]
put the var_dump() or print_r() here: function save_companydetail($details,$id) { $this->db->trans_start(); $this->db->insert('maint_company', $details); $DataId = $this->db->insert_id(); $data['user_id'] = $id; $data['company_id'] = $DataId; // print_r($data); // if there are data on this variable. $this->db->insert('sec_companyaccess', $data); $this->db->trans_complete(); } also try to view all variables used if there are entries on it...
[eluser]maria clara[/eluser]
already solved this one. thanks for the replies. :-) regards, kahtrina |
Welcome Guest, Not a member yet? Register Sign In |