title: Find duplicate email with jquery validation plugin
body: <p>I have a sign-up page where I validate all the field entries with <a href="http://jqueryvalidation.org/" rel="nofollow">jquery validation</a>. How can I use jquery to validate my form to check for duplicates in my mysql database? I tried to use remote method but nothing happens when I type an email which is already in database.</p>
  
  <p><strong>sign_up.php</strong>    </p>
  
  <pre><code>$("#feedbackForm").validate({
      rules: {
          email: {
              required: true,
              email: true,
              remote: "inc/check_email.php"
          }
      },
      messages: {
          email: {
              email: "Insert valid adress",
              required: "Please complete email field",
              remote: "Email is already in use, please change it."
          }
      }
  });
  </code></pre>
  
  <p><strong>/inc/check_email.php</strong>  </p>
  
  <pre><code>&lt;?php
  
  include('config.php');
  
  $email = $_POST['email'];
  $query = mysql_query("SELECT * FROM table WHERE email  = '" . $email . "'");
  
  if (mysql_num_rows($query) &gt; 0) {
      return true;
  } else{
      return false;
  }
  </code></pre>