[eluser]Dennis_gull[/eluser]
Is it possible to trigger the the form_error without using $this->form_validation->run()?
For example if a user is signing in I want the regular validation to run then after the validation I want to check the database to see if the information match anyone, if it does I need to take this information and save it in the session, example:
Code:
if( $this->form_validation->run('login_user') )
{
$result = $this->db->select('id, username, language')->from('users')->where($where)->get()->row();
if(count($result) == 1)
{
// continue with login using the $result variable
}
else
{
// trigger form error
}
}
For this example I can't use a custom_validation because I need the user information after the validation and I don't want to run the query twice.