title: how to check mysql for duplicates with php
body: <p>I need a way to check a database if a word is in it already if so then it doesn't have to be pushed to the database if the word isn't in it yet then it has to be  pushed into it.<br>
  It's a MYSQL database and I have to do it in PHP this is what I got so far.</p>
  
  <pre><code>$result = array_count_values(explode(" ", $filter));
  arsort($result);
  foreach ($result as $word =&gt; $frequency)
  {
      if (!in_array($word, [" ", ""]))
          query("words", "INSERT INTO Woord (woord) VALUE (?)",[$word], false);
  }
  query("words" "SELECT WHERE")
  </code></pre>