title: num_rows not working pdo,mysqli, always return 0
body: <p>I have a interesting problem.</p>
  
  <p>// in pdo with function --> not work</p>
  
  <pre><code>function UserIsExist($name)
  {
      global $db;
      $stmt = $db-&gt;prepare("SELECT id FROM tarskereso_users WHERE email = '$name' LIMIT 1");
          $stmt-&gt;execute();
          if ($stmt-&gt;fetchColumn() == 1) return 1;
          else return 0;
  }
  </code></pre>
  
  <p>// with MySQLi --> not working</p>
  
  <pre><code>function UserIsExist($name)
  {
      global $db;
      $stmt = $db-&gt;prepare("SELECT id,email FROM tarskereso_users WHERE email = ? LIMIT 1");
          $stmt-&gt;bind_param('s', $name);
          $stmt-&gt;execute();
          $stmt-&gt;store_result();
          if ($stmt-&gt;num_rows == 1) 
              return 1;
          else 
              return 0;
          $stmt-&gt;close();
  }
  </code></pre>
  
  <p>// In Register.php</p>
  
  <pre><code> ... other ..
          if(UserIsExist($user) == 1)
              $error_msg = "Is Exist";
          else
          {
              $birthdate = $year.'.'.$month.'.'.$day;
              CreateUser($user,$pass,$birthdate,$sex);
                  $error_msg = 'Success';
          }
  </code></pre>
  
  <p>So, with function not working, I try with:</p>
  
  <pre><code>$stmt = $db-&gt;prepare("SELECT id,email FROM tarskereso_users WHERE email = ? LIMIT 1");
          $stmt-&gt;bind_param('s', $name);
          $stmt-&gt;execute();
          $stmt-&gt;store_result();
  
          if ($stmt-&gt;num_rows &gt; 0) 
              ... other ...
          else 
              echo 'isnt exist...';
          $stmt-&gt;close();
  </code></pre>
  
  <p>but not working, the num_rows always return 0. And the account in the database successfuly created</p>