title: PHP Vaildate that Code exists and the rest of the record is blank
body: <p>Not going to lie here i might be in over my head with this but any help would be appreciated. </p>
  
  <p>So i have a form that takes a promocode and validates that it exists in the DB but at the same time it is looking to see if the email field is null. i have the code below but i am not sure why it isn't thrpwing the error since i have a record in the DB with that promocode and an email address in its field. </p>
  
  <p>I have a feeling that i am missing something small here or i could be WAY off i am not really sure. I have tried email is null as well as email = ''</p>
  
  <pre><code>$dupesql = "SELECT * FROM formdata WHERE (promoCode = '$varPromo' AND email = null)";
  
  $duperaw = $mysqli-&gt;query($dupesql);
  
  
  if($duperaw-&gt;num_rows &gt; 0) {
  $dupe .= "$varPromo has already been used on $varDate \n";
  } 
  </code></pre>