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
This works for me might work for someone
In your controller, create a method similar to this:
function rolekey_exists('table','field','value')
{
$this->roles_model->role_exists($key);
}
And in your model that handles roles, add something like this:
function role_exists($table,$field,$value)
{
$this->db->where($field,$value);
$query = $this->db->get($table);
if (!empty($query->result_array())){
return 1;
}
else{
return 0;
}
}