title: Fatal error: Call to undefined method mysqli_result::rowCount()
body: <p>I have a problem switching from MYSQL to MYSQLi. The codes work fine with MYSQL but when i change the connection to MYSQLi, I received the error as stated above when I'm fetching my query. How can i fetch my queries using mysqli functions?</p>
  
  <p>Code:</p>
  
  <pre><code>        function __construct(){
      $this-&gt;link = mysqli_connect('localhost', 'root', '', 'ajax_rating');
  
      if (!$this-&gt;link) {
       die('Connect Error (' . mysqli_connect_errno() . ') '
          . mysqli_connect_error());
      }
  
      echo 'Success... ' . mysqli_get_host_info($this-&gt;link) . "\n";
  
                  }
  
      function getItems($id = null){
          if(isset($_GET['id']))
          {
              $query = $this-&gt;link-&gt;query("SELECT * FROM items WHERE id = '$id'");
          }
          else
          {
              $query = $this-&gt;link-&gt;query("SELECT * FROM items");
          }
          $rowCount = $query-&gt;rowCount();
          if($rowCount &gt;= 1)
          {
              $result = $query-&gt;fetchAll();
          }
          else
          {
              $result = 0;
          }
          return $result;
  </code></pre>