Welcome Guest, Not a member yet? Register   Sign In
Extending callback function?
#3

[eluser]Unknown[/eluser]
Perfect! Doh, Me!

THANK YOU!

Added localizing the var

if($id == NULL){ $id = $this->uri->segment(3); }
$this->id = $id; <---- here then

Final callback function ended up looking like this:

function edit_email_check($str)
{
// PREVENT EMAIL DUPLICATES
$query = $this->db->query("SELECT * FROM users where email = '$str' AND id != '{$this->id}'");
$cnt = $query->num_rows();
if ($cnt)
{
$this->form_validation->set_message('edit_email_check', 'The %s ' . $str . ' is already in use');
return FALSE;
}
return TRUE;
}


Messages In This Thread
Extending callback function? - by El Forum - 12-22-2010, 10:01 PM
Extending callback function? - by El Forum - 12-22-2010, 10:20 PM
Extending callback function? - by El Forum - 12-22-2010, 10:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB