title: testing for existance of a row in a table using mysqli prepared statement
body: <p>Ive written the following method to test whether a user with username $uname exists in a mysql database. unfortunately it returns no rows, even in cases where the user definately exists. im presuming there is a complication because its a prepared statement but im not sure how/</p>
  
  <pre><code>public function isUserExists($uname)
   {
      $b = false;
      $sql = "SELECT * FROM `User` WHERE `username` = ?";
      $stmt = $this-&gt;conn-&gt;prepare($sql);
      $stmt-&gt;bind_param('s',$uname);
      $result = $stmt-&gt;execute();
  echo "num rows:  ".$stmt-&gt;num_rows;
      if($stmt-&gt;num_rows &gt;= 1)
      {
          echo "user already exists"."&lt;br /&gt;";
          $b = true;
      }
      return $b; 
   }
  </code></pre>