title: using mysqli prepared stmt within "if" condition with "||" and "&&" operator
body: <p>I am just learning mysqli prepared statements and now i have run into a problem and could not get a way out of it. It is the registration form and takes in "username" "email" and "password". if username and email already exists in the database then it doesnot allow registeration. i've used post method and the code is as,</p>
  
  <pre><code>//validating email
  if(!filter_var($user_email, FILTER_VALIDATE_EMAIL) === true) {
      echo "invalid email";
      exit();
  }
  //valid email
  else{
      //prepared query
      $query_name = "SELECT * FROM users WHERE user_name = ?";
      $query_email = "SELECT * FROM users WHERE user_email = ?";
  
      //prepared statements
      $stmt_name = mysqli_prepare($conn, $query_name);
      $stmt_email = mysqli_prepare($conn, $query_email);
  
      //if bind failure
      if((!mysqli_stmt_bind_param($stmt_name, "s", $user_name)) &amp;&amp; (!mysqli_stmt_bind_param($stmt_email, "s", $user_email))){
           echo "bind unsuccessfull";
           exit();
             }
            else{
               //if execution fails
                 if( !mysqli_stmt_execute($stmt_name) &amp;&amp; !mysqli_stmt_execute($stmt_email)){
                     echo "stmt execution failed";
                     exit();
  
                 }
                 //else if execution success
                 else{
  
                      $result_name = mysqli_stmt_store_result($stmt_name);
                      $result_email = mysqli_stmt_store_result($stmt_email);
                      //rows
                      $row_name = mysqli_stmt_num_rows($stmt_name);
                      $row_email = mysqli_stmt_num_rows($stmt_email);
                      echo $row_name;
                      echo $row_email;
                 }
           }
  
  }
  </code></pre>
  
  <p>it looks like the first part before <code>&amp;&amp;</code> in <code>if</code> condition works and the second doesnot work at all. i have tried registering it with existing "email" in the database but the result is still 0.
  the connection is fine and works!
  Any help will be appreciated></p>