title: select distinct where id in a list of values - gives me a wrong result
body: <pre><code>$('#btnmails').on('click', function(){
      let ids = $.map($('.atitle'), (e) =&gt; $(e).attr('data-id'));
      ids = JSON.stringify(ids);
      console.log(ids);  // [&quot;26&quot;,&quot;25&quot;,&quot;24&quot;,&quot;23&quot;,&quot;22&quot;,&quot;21&quot;]
      $.post('pro.php', {fn: 'btn_mails', args: [ids]}, function(data){
          console.log(data);  // 0 - but it is not true
      });
  });
  </code></pre>
  <p><strong>pro.php</strong></p>
  <pre><code>function btn_mails($ids){
      global $db;
      $sq = &quot;select distinct mail from clients where id in ('&quot; . $ids . &quot;')&quot;;
      $st = $db-&gt;prepare($sq);
      $st-&gt;execute();
      $arr = $st-&gt;fetchAll();
      echo count($arr);
  }
  </code></pre>
  <p>I have all six ids in table and each of them with a distinct mail<br />
  so result should be 6 and not 0<br />
  pls help</p>