[eluser]Flemming[/eluser]
Hi gang,
I'm working on my first project with CI (and any framework for that matter) and loving it so far! I'm just following examples and tutorials at the moment and wondering about the best practice for inserting form data to mysql.
I have the following code: (see 'WHAT-GOES-HERE' for where I'm stuck!)
Code:
$fields['username'] = 'Username';
$fields['password'] = 'Password';
$fields['passconf'] = 'Password Confirmation';
$fields['email'] = 'Email Address';
$this->validation->set_fields($fields);
$this->validation->set_error_delimiters('<li>', '</li>');
if ($this->validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
// insert into db!
$data = array('username' => WHAT-GOES-HERE?????, 'password' => WHAT-GOES-HERE?????,'email' => WHAT-GOES-HERE?????, 'url' => WHAT-GOES-HERE?????);
$str = $this->db->insert_string('users', $data);
$this->load->view('formsuccess');
}
as you can see - I'm not sure how to get the validated values into my insert query. Any advice much appreciated!
thanks,
Flemming