title: Check if user exist in database
body: <p>I have a problem i dont know why this dont run </p>
  
  <pre><code>$fb_id = $db-&gt;real_escape_string($fb_id);
          $result = $db-&gt;query("select id,fb_id from users where fb_id='$fb_id'");
          if (mysql_num_rows($result) &gt; 0) {
              echo "user exist";
          } else {
  echo "user dont exist";
          }
  </code></pre>
  
  <p>there is one error</p>
  
  <pre><code>Warning: mysql_num_rows() expects parameter 1 to be resource, object given in 94
  </code></pre>
  
  <p>but in line 94 i have </p>
  
  <pre><code>if (mysql_num_rows($result) &gt; 0) {
  </code></pre>
  
  <p>thanks for help</p>