Welcome Guest, Not a member yet? Register   Sign In
codeigniter 1.7.2 hmvc and form_validation callback
#2

[eluser]mi6crazyheart[/eluser]
I think the problem is in u'r callback function. Try this piece of code...

Code:
function username_check($str)
    {
        $sql = "SELECT COUNT(*) AS count FROM table_name WHERE UserLogin = ? "; // UserLogin= table field where u r storing u'r username
        $binds = array($_POST['username']);
        $query = $this->db->query($sql, $binds);
        $row = $query->row();

        if ($row->count != 0)
        {
            $this->form_validation->set_message('username_check', 'This Login name is all ready exist. Choose a new one');
            return FALSE;
        }
        
    }


Messages In This Thread
codeigniter 1.7.2 hmvc and form_validation callback - by El Forum - 07-29-2010, 01:15 AM
codeigniter 1.7.2 hmvc and form_validation callback - by El Forum - 07-29-2010, 09:46 AM
codeigniter 1.7.2 hmvc and form_validation callback - by El Forum - 07-29-2010, 12:20 PM
codeigniter 1.7.2 hmvc and form_validation callback - by El Forum - 07-29-2010, 12:23 PM
codeigniter 1.7.2 hmvc and form_validation callback - by El Forum - 07-29-2010, 01:16 PM
codeigniter 1.7.2 hmvc and form_validation callback - by El Forum - 08-11-2010, 10:27 PM
codeigniter 1.7.2 hmvc and form_validation callback - by El Forum - 08-11-2010, 11:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB