title: select from database where id in Field
body: <p>I have a Database for news i use multi cats in each news so i have a filed in database called cats and i insert data inside it like that <code>1,5,8,2</code> this data is the cats id.  </p>
  
  <p>And i use this code to select cats from database</p>
  
  <pre><code>$select_newscats = $mysqli-&gt;query("SELECT * FROM news_cats where show_home = '1' and  kind = 1 or kind = 2 order by ord_show asc");
  
  while ($rows_newscats = $select_newscats-&gt;fetch_array(MYSQL_ASSOC)){
  
      $id_newscats          = $rows_newscats ['id'];
      $title_newscats       = $rows_newscats ['title'];
      $ord_show_newscats    = $rows_newscats ['ord_show'];
      $icon_newscats        = $rows_newscats ['icon'];
      $kind_newscats        = $rows_newscats ['kind'];
      $description_newscats = $rows_newscats ['description'];
  
  }
  </code></pre>
  
  <p>i want to select news from database where this  <code>$id_newscats</code> inside cats filed in news table so i traied this code to get news data</p>
  
  <pre><code>$select_newscats = $mysqli-&gt;query("SELECT * FROM news_cats where show_home = '1' and  kind = 1 or kind = 2 order by ord_show asc");
  
  while ($rows_newscats = $select_newscats-&gt;fetch_array(MYSQL_ASSOC)){
  
      $id_newscats          = $rows_newscats ['id'];
      $title_newscats       = $rows_newscats ['title'];
      $ord_show_newscats    = $rows_newscats ['ord_show'];
      $icon_newscats        = $rows_newscats ['icon'];
      $kind_newscats        = $rows_newscats ['kind'];
      $description_newscats = $rows_newscats ['description'];
  
  
      $select_news = $mysqli-&gt;query("SELECT * FROM news where $id_newscats  IN (cats)");
      while ($rows_news = $select_news-&gt;fetch_array(MYSQL_ASSOC)){
  
          $id_new          = $rows_news ['id'];
          $title_news       = $rows_news ['title'];
  
          echo "&lt;div&gt;{$title_news}&lt;/div&gt;";
      }
  }
  </code></pre>
  
  <p>but i have a problem with this code it select only first one for example if i have this cats id's <code>5,2,7</code> it gives me only news from this id <code>5</code> and ignore <code>2,7</code> so how can i fix that and select all news where this id <code>$id_newscats</code> in cats Field Thanks.</p>