title: PHP: Select each value in Array
body: <p>So I have my form and want to retrive all rows that has been checked off.
  But I can't get my LIKE to work as i want to.. It only works of one checkbox is checked off.
  I want to show all the rows that has each value.
  So if you check off "Rock" and "Jazz", it will show all the rows whit either "Rock" Or "Jazz". And that rows whit "Rock, Electronic" also will show up.</p>
  
  <p>Should i have a different aproach to this?</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['submit'])){
    if (isset($_POST['genre'])) {
  
      $genre_str = implode(",", $_POST['genre']);
  
      $sql = $dbcon-&gt;prepare('SELECT * FROM user_profile WHERE user_genre LIKE :user_genre');
      $sql-&gt;bindvalue(':user_genre', "%".$genre_str."%");
      $sql-&gt;execute();
  
      foreach ($sql as $row){
      $row_id = htmlspecialchars($row['id']);
      $row_genre = $row_post['user_genre'];
      echo "id: " . $row_id . " = " . $row_genre;
      echo "&lt;br/&gt;";
      }
    }
  
  }
  ?&gt;
  
  &lt;form action="" method="post"&gt;
    &lt;h4 class="text-center"&gt;Genre&lt;/h4&gt;
    &lt;div class="checkbox"&gt;
      &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="genre[]" value="Rock"&gt;Rock&lt;/label&gt;
      &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="genre[]" value="Funk"&gt;Funk&lt;/label&gt;
    &lt;/div&gt;
  
    &lt;div class="checkbox"&gt;
      &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="genre[]" value="Jazz"&gt;Jazz&lt;/label&gt;
      &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="genre[]" value="Hip-Hop"&gt;Hip-Hop&lt;/label&gt;
    &lt;/div&gt;
  
    &lt;div class="checkbox"&gt;
      &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="genre[]" value="Acoustic"&gt;Acoustic&lt;/label&gt;
      &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="genre[]" value="Electronic"&gt;Electronic&lt;/label&gt;
    &lt;/div&gt;
  
    &lt;div class="col-md-12"&gt;
      &lt;input type="submit" name="submit" class="btn btn-block btn-success" value="Search"&gt;
    &lt;/div&gt;
  &lt;/form&gt; 
  </code></pre>