[eluser]tonanbarbarian[/eluser]
since the code you have there must be included in the controller, then have your main method in the controller store the id in the object before the validation is done
i.e.
Code:
...
$this->id = $id;
$this->validation->run();
...
Then in your callback just lookup the id
Code:
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 “$str is already in use”;
}
return FALSE;
}