title: Issue on Checking Existance of A User in Table
body: <p>I am trying to create account for a new user if the <code>$name</code> and <code>$email</code> dont match with existing records but following snippet is inserting same record as another client while I tried to prevent this at:<code>if( $stmt-&gt;num_rows &gt; 0 ) {}</code></p>
  
  <pre><code>&lt;?php
  
  include_once"dbconfig.php";
  $name = "aaa";
  $email = "a@a.a";
  $phone = "666";
  $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_DATABASE);
  if ($mysqli-&gt;connect_error) {
      die('Error : ('. $mysqli-&gt;connect_errno .') '. $mysqli-&gt;connect_error);
  }
  $sql = "SELECT id, name, email,phone FROM `clients` WHERE `email` = '". $email."' AND `phone` = ". $phone;
  $stmt = $mysqli-&gt;prepare($sql);
  $stmt-&gt;execute();
  $stmt-&gt;bind_result($id, $name, $email, $phone);
  $stmt-&gt;store_result();
  
  if( $stmt-&gt;num_rows &gt; 0 ) {
         echo "This Email already is in system";
      }else{
          $stmt = $mysqli-&gt;prepare("INSERT INTO clients (`name`,`email`,`phone`) VALUES (?, ?, ?)");
          $stmt-&gt;bind_param("sss", $email, $phone, $name);
          $stmt-&gt;execute();
          echo "New records created successfully";
      }
  $stmt-&gt;close();
  $mysqli-&gt;close();
  
  ?&gt;
  </code></pre>
  
  <p>can you please let me know what I am doing wrong?</p>