title: Warning: mysqli_query() expects parameter 1 to be mysqli, object given in
body: <p>I am instentiating $db object this way in my  database class</p>
  <pre><code>class MysqlDB {
  
      protected $_mysql;
      protected $_where = array();
      protected $_query;
      protected $_paramTypeList;
      protected $_crudType = null;
  
      public function __construct($host, $username, $password, $db) {
          $this-&gt;_mysql = new mysqli($host, $username, $password, $db) or die('There was a problem connecting to the database');
      }
  
  
      public function query($query)
      {
          $this-&gt;_query = filter_var($query, FILTER_SANITIZE_STRING);
  
          $stmt = $this-&gt;_prepareQuery();
          $stmt-&gt;execute();
          $results = $this-&gt;_dynamicBindResults($stmt);
          return $results;
      }
          protected function _prepareQuery()
      {
          echo $this-&gt;_query;
          if (!$stmt = $this-&gt;_mysql-&gt;prepare($this-&gt;_query)) {
              trigger_error(&quot;Problem preparing query&quot;, E_USER_ERROR);
          }
          return $stmt;
      }
  
  }
  </code></pre>
  <p>I am using this $db object in another class(profile class) as a link identifier  as</p>
  <pre><code>$db = new MysqlDb('localhost','root','','xxx');
  
  $query=mysqli_query($db,&quot;SELECT id, parent_id, name FROM categories_general&quot;);
  </code></pre>
  <p>How can I get rid of this error? Actually, I am recently shifted from MySQL to mysqli.</p>