title: JQuery Duplicate Email Validation
body: <p>I have just started studying programming and I've been stuck for hours in this problem. I have a sign up form which asks for email and it should check the mysql database if the email is already registered. I am currently trying to use the remote method from the Jquery validator plugin but I can't seem to make it work.</p>
  
  <p><strong>emailcheck.php</strong></p>
  
  <pre><code>&lt;?php
  include_once 'dbconnect.php';
  $email = $_POST['CusEadd'];
  $query = "SELECT CusEadd FROM customer WHERE CusEadd='$email'";
  $result = mysql_query($query);
  $count = mysql_num_rows($result);
  
  if($count&gt;0){
      echo json_encode(FALSE);
  }
  else {
      echo json_encode(TRUE);
  }
  
  ?&gt;
  </code></pre>
  
  <p><strong>form-validation.js</strong></p>
  
  <pre><code>CusEadd: {  
              required:true,
              email:true,
              remote:"emailcheck.php"
          }
  </code></pre>