title: difference between where_in and find_in_set
body: <p>I am working on a join query in which I have to get the data from a column which contain the comma separated values.like <code>allowed_activity</code> contain <code>1,2,3,4,5,6</code>
  this the <code>activity_id</code> which is allowed.</p>
  
  <p>So In the query, I am checking that current activity is allowed or not and for that, I have used <code>where_in</code> and also tried <code>find_in_set</code> in <code>where</code> condition.</p>
  
  <p>Here is that part of the query:</p>
  
  <pre><code>$this-&gt;db-&gt;where_in('a.allowed_activity',$activity_id);
  //And With FIND_IN_SET
  $this-&gt;db-&gt;where("FIND_IN_SET($activity_id, a.allowed_activity) !=",0);
  </code></pre>
  
  <h3>Problem or Confusion</h3>
  
  <p>When I use <code>where_in</code> it doesn't give me the result. But if I use  <code>FIND_IN_SET</code> then it will return the desired result. I thought that <code>where_in</code> can do the task but it didn't. </p>
  
  <blockquote>
    <p>Just Want to know why <code>find_in_set</code> working differently than
    <code>where_in</code>
    Because of both the function work same as finding the data is in comma separated list. </p>
  </blockquote>
  
  <p>Here is the complete query:</p>
  
  <pre><code>SELECT mycolumns
  FROM `table1` as `ea`
  LEFT OUTER JOIN `table2` as `a` ON `ea`.`package_id` = `a`.`id`
  LEFT OUTER JOIN `table3` as `e` ON `ea`.`employer_id` = `e`.`id`
  WHERE `ea`.`card_id` &gt; 0
  AND FIND_IN_SET(6, a.allowed_activity) !=0
  AND `ea`.`id` = '6'
  ORDER BY `ea`.`creation_date` DESC
  </code></pre>
  
  <p>I am using Codeigniter Active record. </p>