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
Yes, if you want to check whether a value already exist in the database, it's correct to add is_unique in the validation side. So, you don't need to create a function in your controller to do it.
$this->form_validation->set_rules('rolename', 'Role Name', 'trim|required|xss_clean|is_unique[table_name.table_field]');
$this->form_validation->set_rules('rolekey', 'Role Key', 'trim|required|xss_clean|is_unique[table_name.table_field]');
Then, you will see an error message in the input area. For example: The username field must contain a unique value.
I have tested it in Codeigniter 3.0.0.