title: How to check multiple values to be unique in CodeIgniter
body: <p>I've a html form that is used for registration of users. I want to apply a condition in codeIgniter that if someone writes 2 input fields(firstname and lastname) that already exists in database then don't allow to insert the data.
  Like I can write </p>
  
  <pre><code>$this-&gt;form_validation-&gt;set_rules('firstname', 'First Name', 'required|is_unique[student.firstname]');
  $this-&gt;form_validation-&gt;set_rules('lastname', 'Last Name', 'required|is_unique[student.lastname]');
  </code></pre>
  
  <p>How to apply on both? Like both should be unique but one can already exist. I want something like "Combined unique value"</p>
  
  <p><strong>Example:</strong></p>
  
  <blockquote>
    <p>First Name: Ali</p>
    
    <p>Last Name: Mohyudin</p>
  </blockquote>
  
  <p>If someone writes again the same in both fields then I don't want to insert data in database but if someone writes something like:</p>
  
  <blockquote>
    <p>First Name: Ali</p>
    
    <p>Last Name: Imran</p>
  </blockquote>
  
  <p>then I should accept the user.</p>