title: how to use array in where clause in Codeigniter
body: <p>I'm using codeigniter, trying to use an array in where clause and return only those id match with array.</p>
  
  <p>Submitted by form:</p>
  
  <p><code>$arrTID = $this-&gt;input-&gt;post('Present'); 
  print_r($arrTID);</code></p>
  
  <p>output:</p>
  
  <pre><code>Array(
   [0]=&gt;FMM003
   [1]=&gt;30089
   [2]=&gt;30097
  )
  </code></pre>
  
  <p>When use in foreach:</p>
  
  <pre><code>foreach($arrTID as $key=&gt;$ID){               
   print_r($ID);
  }
  </code></pre>
  
  <p>output: FMM0033008930097</p>
  
  <p>query:</p>
  
  <pre><code>$query = $this-&gt;db-&gt;query("select TraineeID from tbl_attendance_processed where TraineeID IN $ID and attnDate='$atnDate'");
  $res=$query-&gt;result_array();
  </code></pre>
  
  <p>I'm actually need that query return those ID in array which match with this query. How do get this?</p>