Welcome Guest, Not a member yet? Register   Sign In
Update form data into database
#2

(This post was last modified: 01-09-2019, 01:23 PM by Wouter60.)

Before $this->load->view('formsuccess'); insert this piece of code:
PHP Code:
$data = array(
 
  'certno' => $this->input->post('certno'),
 
  'location' => $this->input->post('location'),
 
  'workdate' => $this->input->post('workdate'),
 
  'dateofreceipt' => $this->input->post('dateofreceipt'),    
   
'customername' => $this->input->post('customername'), 
);
$this->db->insert('mytablename'$data); 

Alternatively you can create a model that stores the information, but that won't make your code much shorter.
If you need to use the same database actions repeatedly in different functions in your controller (or different controllers), then consider using a model.
Reply


Messages In This Thread
RE: Update form data into database - by Wouter60 - 01-09-2019, 10:57 AM
RE: Update form data into database - by qury - 01-10-2019, 05:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB