title: check if two values already exist in a table codeigniter
body: <p>I.m trying to check if a value exists in two columns from a table. The column names are on_number and off_number.  </p>
  
  <p>I've tried the following in my controller. The check works however for only the off_number columns and not the on_number.</p>
  
  <p>my controller.</p>
  
  <pre><code> public function check()
          {
              $on_number = !empty(get('on_number')) ? get('on_number') : false;
              $notId = !empty($this-&gt;input-&gt;get('notId')) ? $this-&gt;input-&gt;get('notId') : 0;
              if($on_number)
                  $exists = count($this-&gt;duty_book_model-&gt;getByWhere([
                          'on_number' =&gt; $on__number,
                          'id !=' =&gt; $notId,
                      ])) &gt; 0 ? true : false;
                  if($on_number)
                  $exists = count($this-&gt;duty_book_model-&gt;getByWhere([
                          'off_number' =&gt; $on_number,
                          'id !=' =&gt; $notId,
                      ])) &gt; 0 ? true : false;
              echo $exists ? 'false' : 'true';
          }
  
   My Model 
  
      class Duty_book_model extends MY_Model {
  
          public $table = 'tbl_duty_type';
  
          public function __construct()
          {
              parent::__construct();
          }
      }
  </code></pre>
  
  <p>The extends MY_Model has:  </p>
  
  <pre><code>public function getByWhere($whereArg, $args = [])
      {
  
          if(isset($args['order']))
              $this-&gt;db-&gt;order_by($args['order'][0], $args['order'][1]);
  
          return $this-&gt;db-&gt;get_where($this-&gt;table, $whereArg)-&gt;result();
      }
  </code></pre>
  
  <p>I would like it to check both columns if the value exists.</p>