how to check if username already exists in codeigniter

后端 未结 8 1364
无人共我
无人共我 2020-12-20 00:33

I am working on a site in codeigniter.I am not so expert using framework.Here I have to check if email already exists in database.I have coded the required functionality but

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-20 00:57

    Use is_unique[table.field] add table name and field.

    $this->form_validation->set_rules(
        'email', 'Email', 'trim|required|valid_email|is_unique[table.field]|callback_isEmailExist'
    );
    

提交回复
热议问题