[eluser]Unknown[/eluser]
I am doing a simple user registration. I prepped the data along with the validation rules just as the documentation stated.
Code:
this->form_validation->set_rules('first_name', 'First name', 'trim|required|max_length[30]|xss_clean');
$this->form_validation->set_rules('last_name', 'Last name', 'trim|required|max_length[30]|xss_clean');
$this->form_validation->set_rules('password', 'Password', 'required|min_length[7]|max_length[15]|matches[password_conf]|xss_clean|md5');
$this->form_validation->set_rules('password_conf', 'Password confirmation', 'required|max_length[15]');
//**enforce stronger passwords
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|max_length[50]|xss_clean|callback_is_id_unique');
$this->form_validation->set_rules('phone', 'Phone', 'trim|required|numeric|max_length[10]|xss_clean');
Now I am ready to insert the info into the database. something like this.
Code:
$data = array(
'email' => 'email???',
'password' => 'password???',
'first_name' => 'first_name???',
'registration_date' => now(),
'last_name' => 'last_name????',
'phone' => 'phone????',
);
$this->db->insert('tblcustomers', $data);
I need to insert the prepped data instead of just the POST data. How do I go about doing this???
Any helo will be greatly appreciated. Thanks!