title: Find list of words(comma separated number) that are present in text based column in mysql database
body: <p>I am using php/mysql.<br>
  I am storing comma separated 6 digit numbers in text based column of table in database.</p>
  
  <p>I want to get the  method to  find which numbers  in given range are present  in my database.</p>
  
  <p>My table  looks like :</p>
  
  <pre><code> |id|date|commaSeperatedList|
  </code></pre>
  
  <p>Now as input to sql I want to give a range of number (e.g 234101-234200).</p>
  
  <p>Therefore I am expecting output to be in form of :</p>
  
  <pre><code>  |id|date|number|
  </code></pre>
  
  <p>So, far the solution I have worked on is : Use of PHP's range function.</p>
  
  <p>Using that I created a string based Long Where Clause.</p>
  
  <pre><code>     foreach( $words as $word) {
        $word=str_pad($word, 6, '0', STR_PAD_LEFT);
       $whereClause .= ' commaSeperatedList LIKE "%' . $word . '%" OR';
      } 
  </code></pre>
  
  <p>Problem with it is that : I dont get to know exactly which were the numbers that were found common . </p>
  
  <p>e.g  lets say List has :
  109001,234122,234123,345650</p>
  
  <p>I am giving the range (234101-234200)</p>
  
  <p>The above statement finds all rows that contain any number in provided range . However I also want to know which exact numbers were matched. In my provided example these numbers are : 234122,234123</p>
  
  <p>So, expected output should be :</p>
  
  <pre><code>   |1|date|234122|
     |1|date|234123|
  </code></pre>
  
  <p>Any help in this regard will be appreciated.</p>