title: I need help in a query to my db
body: <p>I'm here with a problem in a query . Need to insert emails in my database but are not repeated . The email 's are entered separated by commas or semicolons. I leave the code I have so far:</p>
  
  <pre><code>$separador = $_POST['separador'];
  $listemails= explode($separador, $_POST['emails']);
  $count = count($listemails);
  for($i=0; $i &lt; $count; $i++){
      $check = $connection -&gt; query("SELECT * FROM emails WHERE email_endereco='$listemails[$i]'") or die($connection -&gt; error);
      if($res = $check -&gt; fetch_array(MYSQLI_ASSOC)){
          ...
      }
      $result = $connection -&gt; query("INSERT INTO emails VALUES(NULL, '".$listemails[$i]."')") or die($connection -&gt; error);
      $lastid = $connection -&gt; insert_id;
      $connection -&gt; query("INSERT INTO emails_lists VALUES(NULL,'$lastid','$l')") or die($connetion -&gt; error);
  } 
  </code></pre>
  
  <p>What I miss the place where I have the ellipsis?</p>