title: Check for duplicate emails before querying
body: <p>I've searched and look at other examples but as i'm new i'm having trouble translating over to my code. What I want to do is have it check the database to see if that email has already been entered. If it has I want it to tell them it has and that there is only one entry per person. Any help would be greatly appreciated. Keep in mind this is the first thing I've ever coded that connects to a database.</p>
  
  <pre><code>&lt;?php //data.php
  
  
  // Get values from form
  $name        = $_POST['name'];
  $email        = $_POST['email'];
  
  $user_name = "user";
  $password = "password";
  $database = "dbname";
  $server = "ahostsomewhere";
  
  $db_handle = mysql_connect($server, $user_name, $password);
  $db_found = mysql_select_db($database, $db_handle);
  
  if ($db_found) {
  $SQL = "INSERT INTO contestant_drawing (name, email) VALUES ('" . $name . "', '" .    $email . "')";
  $result = mysql_query($SQL);
  echo "To finalize your entry like our FaceBook Page, Good Luck!";
  
  mysql_close($db_handle);
  
  
  }else {
  print "Database NOT Found ";
  mysql_close($db_handle);
  
  }
  ?&gt;
  </code></pre>