Neeed update code for my programme :             controller code i have :
        
        <?php
        class Latest_ctrl extends Ci_controller{
        
        
        	public function insert(){
        
        		$name=$this->input->post('name');
        		$pass=$this->input->post('pass');
        		$email=$this->input->post('email');
        		$mobile=$this->input->post('mobile');
        		$address=$this->input->post('address');
        		$data=array(
        			'name'=>$name,
        			'pass'=>$pass,
        			'email'=>$email,
        			'mobile'=>$mobile,
        			'address'=>$address
        			);
                $this->load->model('latest_model');
        		 $query= $this->db->insert('form',$data);
        		 if($query){
        		 	redirect('latest_ctrl/view');
        		 }
        		 	}
        
        	public function view(){
        		 $this->load->model('latest_model');
        		 $val=$this->latest_model->get_data();
        		  $data['value']=$val;
        		  $this->load->view('latest',$data);
        	}
        	public function index(){
        $this->load->view('new_login');
        	}
        
        	public function delete($id){
             $id=$this->uri->segment(3);
             $this->load->model('latest_model');
              $this->latest_model->delete_id($id);
              redirect(base_url('latest_ctrl/view'));
        
        	}
        
        	Public function update($id){
        		$upd=$this->uri->segment(3);
        		$data = array(
        		'name' => $this->input->post('name'),
        		'pass' => $this->input->post('pass'),
        		'email' => $this->input->post('email'),
        		'mobile' => $this->input->post('mobile'),
        		'address' => $this->input->post('address')
        		);
              $this->load->model('latest_model');
        
        	}
        }
        ?>
    
        Model code i have :
    <?php
    class Latest_model extends CI_model{
    
    
     public function insert($tableName,$data){
           return $this->db->insert($tableName, $data);
        }
    
    	public function get_data(){
    		$query = $this->db->get('form');
    		if ( $query->num_rows() > 0 )
            {
            $row=$query->result();
            return $row;
            }
    	}
    
    	public function delete_id($id){
    		$this->db->where('id', $id);
            $this->db->delete('form'); 
    	}
    
    
    public function update_data(){
    	
    }
    }
    
    
    ?>
    
    view i have :
    
    <!DOCTYPE html>
    <html>
    <head>
    	<title></title>
    </head>
    <body>
    
    
    
    <h1>Welcome Page </h1>
     <form action="<?php echo base_url();?>latest_ctrl/insert" method="post">
    <table >
    <tr>
    	<td colspan=2 align="center"><h3>User Details</h3></td>
    </tr>
    <tr>
    	<td>
    		<?php echo form_label('Name'); ?>
    	</td>
    	<td>
    		<?php echo form_input(array('id' => 'name', 'name' => 'name','value'=>'')); ?>
    	</td>
    </tr>
    <tr>
    	<td>
    		<?php echo form_label('Pass'); ?>
    	</td>
    	<td>
    		<?php echo form_password(array('id' => 'pass', 'name' => 'pass')); ?>
    	</td>
    </tr>
    <tr>
    	<td><?php echo form_label('Email'); ?>
    </td>
    <td><?php echo form_input(array('id' => 'email', 'name' => 'email')); ?></td>
    </tr>
    <tr>
    	<td><?php echo form_label('Mobile'); ?>
    </td>
    	<td><?php echo form_input(array('id' => 'mobile', 'name' => 'mobile')); ?>
    </td>
    </tr>
    <tr>
    	<td>
    		<?php echo form_label('Address'); ?>
    	</td>
    	<td>
    		<?php echo form_input(array('id' => 'address', 'name' => 'address')); ?>
    	</td>
    </tr>
    <tr>
    	<td colspan="2" align="center"><?php echo form_submit(array('id' => 'submit', 'value' => 'Submit')); ?>
    </td>
    </tr>
    </form>
    </table> 
    
    </body>
    </html>


i want to edit a particular record for that purpose i need model and controller code to update the record i am newbie in codeigniter thanks in advance
 also i have a page which redirect the page to the update controller but i want only update code for model and controller for update purpose
