Welcome Guest, Not a member yet? Register   Sign In
simple_query question
#4

[eluser]xwero[/eluser]
tel is an alias of the count(*) function so you won't have to do $row->count(*), i don't think it will work.

To make a callback function you have to define the message.
Code:
function _checkEmailAddress($str) // start with an underscore to make function invisible for the routing
{
   $query = $this->db->query("SELECT count(*) tel FROM users WHERE emailAddress = ?",array($emailAddress));
   $row = $query->row();
   if ($row->tel == 0)
   {
      $this->validation->set_message('_checkEmailAddress', 'The %s field doesn't exist in our database');
      return false;
   }
   else
   {
      return true;
   }
}
// to add to the rules
$rules['emailAddress']    = "required|valid_email|callback__checkEmailAddress"; // two underscores


Messages In This Thread
simple_query question - by El Forum - 01-14-2008, 02:30 AM
simple_query question - by El Forum - 01-14-2008, 02:39 AM
simple_query question - by El Forum - 01-14-2008, 02:44 AM
simple_query question - by El Forum - 01-14-2008, 02:57 AM
simple_query question - by El Forum - 01-14-2008, 06:13 AM
simple_query question - by El Forum - 01-15-2008, 01:13 AM
simple_query question - by El Forum - 01-15-2008, 03:54 AM
simple_query question - by El Forum - 01-15-2008, 06:06 AM
simple_query question - by El Forum - 01-16-2008, 12:32 AM
simple_query question - by El Forum - 01-16-2008, 03:16 AM
simple_query question - by El Forum - 01-16-2008, 09:41 PM
simple_query question - by El Forum - 01-17-2008, 02:26 AM
simple_query question - by El Forum - 01-18-2008, 07:05 AM
simple_query question - by El Forum - 01-18-2008, 02:35 PM
simple_query question - by El Forum - 01-18-2008, 02:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB