<?php
    namespace DB;

    include (SYSTEM_PATH . 'db/IDriver.php');

    class DB
    {
        private $dbDriver;

        public function __construct()
        {
            $config =& loadClass('Config', 'Core');
            $cfg = $config->load('DB');

            if ($cfg !== false)
            {
                $this->driver($cfg['driver']);
                $this->connect($cfg['host'], $cfg['user'], $cfg['password']);
                $this->database($cfg['database'], false);
            }
        }

        public function driver($name)
        {
            $loader =& loadClass('Loader', 'Core');
            $this->dbDriver = $loader->dbDriver($name);
        }

        public function connect($host, $user, $password='')
        {
            $this->dbDriver->connect($host, $user, $password);
        }

        public function database($name, $create=false)
        {
            $this->dbDriver->database($name);
        }

        public function query($sql, $data=[])
        {
            if (count($data) > 0)
            {
                return $this->dbDriver->bind($sql, $data);
            }
            else
            {
                return $this->dbDriver->query($sql);
            }
        }
    }

?>

<?php
    namespace DB;

    include (SYSTEM_PATH . 'db/IDriver.php');

    class DB
    {
        private $dbDriver;

        public function __construct()
        {
            $config =& loadClass('Config', 'Core');
            $cfg = $config->load('DB');

            if ($cfg !== false)
            {
                $this->driver($cfg['driver']);
                $this->connect($cfg['host'], $cfg['user'], $cfg['password']);
                $this->database($cfg['database'], false);
            }
        }

        public function driver($name)
        {
            $loader =& loadClass('Loader', 'Core');
            $this->dbDriver = $loader->dbDriver($name);
        }

        public function connect($host, $user, $password='')
        {
            $this->dbDriver->connect($host, $user, $password);
        }

        public function database($name, $create=false)
        {
            $this->dbDriver->database($name);
        }

        public function query($sql, $data=[])
        {

        }
    }

?>

--- 
+++ 
@@ -38,7 +38,14 @@
 
         public function query($sql, $data=[])
         {
-
+            if (count($data) > 0)
+            {
+                return $this->dbDriver->bind($sql, $data);
+            }
+            else
+            {
+                return $this->dbDriver->query($sql);
+            }
         }
     }
 
Use normal query if no data is passed or using bind method if there is data passed
