title: CodeIgniter - Checking to see if a value already exists in the database
body: <p>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 already exists in the database.</p>
  
  <p>This is what i have for my form validation rules so far</p>
  
  <pre><code>$this-&gt;form_validation-&gt;set_rules('rolename', 'Role Name', 'trim|required|xss_clean');
  $this-&gt;form_validation-&gt;set_rules('rolekey', 'Role Key', 'trim|required|xss_clean');
  </code></pre>
  
  <p>The 'rolekey' is what i need to check against the 'rolekey' column in the database to see if it exists, if it does i need to shoot back an error.</p>
  
  <p>Any help would be grand.</p>
  
  <p>Cheers,</p>