title: MySQLi Prepare Statement and OOP PHP Query Returns 0 Row
body: <p>Trying to get data from MySQLi using PHP OOP apporoach I am getting <code>No rows</code> while  I am sure I have match row in the database</p>
  
  <p>I have a class called <code>db</code> stored in a file as <code>db.inc.php</code> and it is like</p>
  
  <pre><code>&lt;?PHP
  class db {
      private $DBSERVER;
      private $DBUSERNAME;
      private $DBPASSWORD;
      private $DBNAME;
  
      protected function connect(){
        $this-&gt;DBSERVER   = "localhost"; 
        $this-&gt;DBUSERNAME = "root"; 
        $this-&gt;DBPASSWORD = ""; 
        $this-&gt;DBNAME     = "maator"; 
  
        $conn = new mysqli($this-&gt;DBSERVER, $this-&gt;DBUSERNAME, $this-&gt;DBPASSWORD, $this-&gt;DBNAME);
        if ($conn-&gt;connect_error) {
          die("Connection failed: " . $conn-&gt;connect_error);
        }     
        return $conn;
      }
  }
  ?&gt;
  </code></pre>
  
  <p>I have an extended class called <code>SetData</code> in <code>SetData.inc.php</code> which like</p>
  
  <pre><code>&lt;?PHP
  include_once('db.inc.php'); 
  class SetData extends db {
      private $page;
      private $region;
      private $conn;
  
      function __construct() {
         $this-&gt;conn = new db();
      }
  
     public function SetBox($vpage, $vregion){
          $this-&gt;page     = $vpage;
          $this-&gt;region = $vregion;
          $stmt = $this-&gt;conn-&gt;connect()-&gt;prepare("SELECT `title`,`description` FROM html WHERE `page` = ? AND `region` = ?");
          $stmt-&gt;bind_param("ss", $this-&gt;page, $this-&gt;region);    
          $stmt-&gt;execute();
          $stmt-&gt;store_result();
         if($stmt-&gt;num_rows === 0) exit('No rows');
          $stmt-&gt;bind_result($titlerow,$descriptionrow);
          $stmt-&gt;fetch();
              $title = $titlerow;
              $description = $descriptionrow;
          $stmt-&gt;free_result();
          $stmt-&gt;close();
      }
  }
  ?&gt;
  </code></pre>
  
  <p>and finally in front page I have</p>
  
  <pre><code>&lt;?PHP
  $page = 'game';
  $region = 'ASIA';
  include '../inc/SetData.inc.php';
  $cls = new SetData();
  $cls-&gt;SetBox($page, $region);
  </code></pre>