title: MySQL Search query with like
body: <p>i have database table with few text fields which i use to filter data , each of this text fields contain number data separated with colon ( for example '1:2:4:5:6:7:9' ) </p>
  
  <pre><code>id   |  title         |  field1                 | filed2     | field3            |
  1    | Some title1    |1:2:3:4:5:6:7            |1:2:3:6:7   | 1:2:4:5:7:9:10:11 | 
  2    | Some title2    |1:2:3:4:5:6:7:8:9:10:11  |1:2:3:4:5:6 | 1:2:4:5:7:9:10:11 |
  3    | Some title3    |1:2:3:4:5:6:7            |1:2:3:6:9   | 1:2:4:5:7:9:10:11 |
  4    | Some title4    |3:4:5:6:7:10:11          |1:2:3:10:11 | 1:2:4:5:7:9:10:11 |
  5    | Some title5    |1:2:3:4:5:6:7            |1:2:3:6:7   | 1:2:4:5:7:8:9:11  |
  6    | Some title6    |2:3:4:5:6:7:9            |1:2:3:6:7   | 1:2:4:5:7:9       |
  </code></pre>
  
  <p>using a search form i use check boxes for each parameters for field1, field2 and field3 and use php foreach to create LIKE '%<code>parameter</code>%' for each field </p>
  
  <p>my SQL query look like
   <code>SELECT * FROM table WHERE (field1 LIKE '%1%' OR field LIKE '%2%' ) AND (field2 LIKE '%1%' OR field2 LIKE '%2%')</code></p>
  
  <p>unfortunately this query doesn't give me good result since i get back rows which doesn't match my idea :)</p>
  
  <p>for example if checkboxes values 1,2,3,4,5,6,7 are selected by user 
  query need to return only 1, 3 and 5th row </p>
  
  <p>is there any better solution for filtering this results </p>
  
  <p>regards</p>
  
  <p>Additional Info:</p>
  
  <p>Let me try to explain you a little bit more the idea <br /> User check chekboxes with some values (ie. 1,3,4,5,6,7) script need to return only results which contain those values in field1 same thing happens when user check other checkboxes which control field2 and field3 but for now it's not important</p>
  
  <h2>Additional info pt2.</h2>
  
  <p>I'll try to give you all better explanation what i want to achieve</p>
  
  <p>I have search form with checkboxes and radio input fields, each checkbox group ( values from 1 to 10 ) are represent columns ( field1, field2, field3 ) in table, each value in columns field1 for example represent selected checkboxes ( which are set in admin panel for each row ) now by default all check boxes are selected and i get all results now when user deselect respective checkbox results need to be filtered up with rows according to filter 
  good example what i try to achieve is <a href="http://www.hotelscombined.com/City/London.htm" rel="nofollow">http://www.hotelscombined.com/City/London.htm</a> </p>
  
  <p>so if checkbox with value 2 is deselected it can't be listed in results </p>
  
  <p>BR
  Sile</p>