title: Errors while submitting data to the server using form
body: <p>I am trying to submit data through form and came across the below error:</p>
  
  <blockquote>
    <p>Warning: <code>mysql_num_rows()</code> expects parameter 1 to be resource, boolean given ..</p>
  </blockquote>
  
  <p>Please find the code I have tried.</p>
  
  <pre><code>//connection end to my data server.
  
  if(isset($_POST["submit"])) {
  
       $user_name = $_POST['name'];
       $user_email = $_POST['email'];
       $user_skype = $_POST['skype'];
  
      if($user_name==""){
          echo "&lt;script&gt;alert('please enter your user name!')&lt;/script&gt;";
          exit();
      }
  
      if($user_email==""){
          echo "&lt;script&gt;alert('please enter your email!')&lt;/script&gt;";
          exit();
      }       
  
      if($user_skype==""){
          echo "&lt;script&gt;alert('please enter your skype id.')&lt;/script&gt;";
          exit();
      }   
  
      $check_email = "select * from binary where user_email = '$user_email' ";
  
      $run = mysql_query($check_email);
  
      if(mysql_num_rows($run)&gt;0){
  
      echo "&lt;script&gt;alert('Your email $user_email address already exist. please try another.')&lt;/script&gt;";
      exit();
  
      }
  
      $query= "insert into binary (user_name, user_email, user_skype) values('$user_name','$user_email','$user_skype')";
  
      if(mysql_query($query)){
      echo "&lt;script&gt;window.open('success.html','_self')&lt;/script&gt;";
      }
  
  }
  
  ?&gt;
  </code></pre>