title: Check if value exists in database?
body: <p>I will preface this by saying I've been stuck on this for a couple days, I am obviously new and know I'm missing something simple. I've tried so many ways. Security is not an issue yet and I am just trying to learn on my own server.</p>
  
  <p>I always get 'something found' even when I know the value does not exists. I am trying to enter a phrase into an input field, press submit and see if the value already exists in the table</p>
  
  <p>Sorry for the dumb question. </p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL); 
  ini_set('display_errors', 1); 
  // error_reporting(0);
  // ini_set('display_errors', 0); 
  // exit();
  //echo '&lt;pre&gt;';  print_r($user_info);  echo '&lt;/pre&gt;';
  
  if ( (isset($_POST['lookup'])) &amp;&amp; ($_REQUEST['lookup'] =='1')) {
      echo 'you\'ve entered a keyword, lets see if it exsists!';
      $looksql = "SELECT * FROM `crm3`.`keywords` WHERE `KW0` LIKE '".$_POST['lookup']."' ORDER BY `ID` ASC ";
      if ($result = mysqli_query($db, $looksql)) {
          echo '&lt;br&gt;someting found';
      } else { echo '&lt;br&gt;nothing found'; }
  } else {
      echo '&lt;br&gt;please enter a keyword to start the search';
  }
  ?&gt;
  
  &lt;br&gt;&lt;br&gt;&lt;br&gt;
  &lt;form method="POST" action="./?action=kwcheck"&gt;
      &lt;input type="hidden" name="lookup" value="1" /&gt;
      keyword lookup: &lt;input type="text" name="keyword" /&gt;&lt;br&gt;
      &lt;input type="submit" value="SEARCH" /&gt;
  </code></pre>