• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update form data into database

#2
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.