title: Loop on Codeigniter
body: <p>I have a table that contains an unknown number of elements. These represent business sectors.</p>
  
  <pre><code>Array ([0] =&gt; 1 [1] =&gt; 3 [2] =&gt; 6 [3] =&gt; 7)  
  </code></pre>
  
  <p>In this case this activity is linked to topics 1, 3, 6 and 7.</p>
  
  <p>I Have some members who have indicated their fields of interest when they register. Interest fields correspond to sectors of activities.</p>
  
  <p>When a new activity is announced, I would like to send an email to members who have checked at least one common interest with the activity. But I have no idea how to retrieve the email of all those members().</p>
  
  <p>In the database the interests of members is stored like this: <code>246</code>
  The first member would be interested in sectors 2, 4 and 6.</p>
  
  <p><a href="https://i.stack.imgur.com/EqQgN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EqQgN.jpg" alt="enter image description here"></a></p>
  
  <p>I know how to do if there is only one business sector for the activity (example if value = 1). </p>
  
  <pre><code>function readMemberInterest($value) {
      $datas = $this-&gt;db-&gt;select("email")
                  -&gt;from($this-&gt;table)
                  -&gt;like('interet',$value,'both');
  
                    return $datas;
  
  }
  </code></pre>
  
  <p>But I do not know where and how to place my LOOP and my OR (is for example value = Array ([0] => 1 <a href="https://i.stack.imgur.com/EqQgN.jpg" rel="nofollow noreferrer">1</a> => 3 [2] => 6 [3] => 7) ). </p>
  
  <p><strong>Briefly, I want to retrieve email members who have at least one common interest with activity. Any tips?</strong></p>
  
  <p>I hope to be clear, my English is not so great ...
  Thanks</p>