I am calling the controller function via ahref tag and i want to pass the current record no to the controller to update the record current value is stored in$currentID and i pass this value in input type..but i didn't get the value from the view page..i tried var_dump($id)..it shows null Controller Code to update:
public function update($id='') { $session_data = $this->session->userdata('logged_in'); $data['username'] = $session_data['username']; $id=$this->input->post('update'); echo "<pre>";var_dump($id); $dc=$this->input->post('dc'); if($dc=='c'){ $amount=$this->input->post('credit1'); } else if ($dc=='d') { $amount=$this->input->post('debit'); } $data=array( 'date' =>$this->input->post('TDate'), 'code' =>$this->input->post('TName'), 'project' =>$this->input->post('TName1'), 'part' =>$this->input->post('part1'), 'part1' =>$this->input->post('part2'), 'dc'=>$this->input->post('dc'), 'amount'=>$amount, ); $this->db->where('recno', $id); $this->db->update('daybook', $data); $this->session->set_flashdata('Add1', 'Updated Successfully'); redirect('BookKeeping/daybook','refresh'); } calling update
<a href="<?=site_url('BookKeeping/update/'.$currentID)?>" class="btn btn-info btn-"><i class="icon-new position-left"> <input type="hidden" name="update" id="id" value="<?php echo $currentID?>"> </i>Update</a> Help me to pass the currentvalue to the controller..Thanks in advance