public function connect($type, $host, $dbname = '', $username = null, $password = null, array $options = array())
    {
        if ($this->PDO) {
            // If this object already has a PDO object, don't attempt a new connection
            return $this;
        }

        $dsn = '';

        if ($type == 'sqlite') {
            $dsn = "{$type}:{$host}";
        } else {
            $dsn = "{$type}:host={$host};dbname={$dbname}";
        }
        $PDO = new PDO($dsn, $username, $password, $options);

        if (!$PDO) {
            return false;
        }

        $this->PDO = $PDO;

        $this->setEscapeChar();
        return $this;
    }