Skip to content

Instantly share code, notes, and snippets.

@anjanawijesundara
Created April 25, 2015 15:41
Show Gist options
  • Save anjanawijesundara/2f22e0c338d47c9c0527 to your computer and use it in GitHub Desktop.
Save anjanawijesundara/2f22e0c338d47c9c0527 to your computer and use it in GitHub Desktop.
Getting Start with Codeigniter -Ccreating a CRUD Application [Customer_model.php Part 3 set_customer and update_customer ]
public function set_customer(){
$data = array(
'username' => $this->input->post('username'),
'full_name' => $this->input->post('full_name'),
'email' => $this->input->post('email')
);
return $this->db->insert('customer', $data);
}
public function update_customer(){
$data = array(
'username' => $this->input->post('username'),
'full_name' => $this->input->post('full_name'),
'email' => $this->input->post('email')
);
$this->db->where('username', $this->input->post('username'));
return $this->db->update('customer', $data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment