CodeIgniter - Checking to see if a value already exists in the database

后端 未结 7 1741
我在风中等你
我在风中等你 2020-12-24 13:25

Im running CodeIgniter for a project of mine ... Im fairly new to this, i have the standard form validation checks for my form, except im unsure of how to check if the value

7条回答
  •  失恋的感觉
    2020-12-24 13:43

    You just edit your validation rule

    $this->form_validation->set_rules('rolename', 'Role Name', 'trim|required|xss_clean|is_unique[table_name.rolename]'); 
    

提交回复
热议问题