QuickBooks/Driver/Sql/Sqlite3.php
protected function _query($sql, &$errnum, &$errmsg, $offset = 0, $limit = null)
    {
        if ($limit and strtoupper(substr(trim($sql), 0, 6)) == 'SELECT')
        {
            if ($offset)
            {
                $sql .= " LIMIT " . (int) $offset . ", " . (int) $limit;
            }
            else
            {
                $sql .= " LIMIT " . (int) $limit;
            }
        }
        else if ($offset and strtoupper(substr(trim($sql), 0, 6)) == 'SELECT')
        {
            // @todo Should this be implemented...?
        }

        try {

            $res = $this->_conn->query($sql);

            if (!$res)
            {
                $errnum = -99;
                $errmsg = 'SQLLite Query Error';

                trigger_error('Error Num.: ' . $errnum . "\n" . 'Error Msg.:' . $errmsg . "\n" . 'SQL: ' . $sql, E_USER_ERROR);
                return false;
            }
        }
        catch(\Exception $e) {
            trigger_error($e->getMessage());
        }

        return $res;
    }
protected function _query($sql, &$errnum, &$errmsg, $offset = 0, $limit = null)
    {
        if ($limit and strtoupper(substr(trim($sql), 0, 6)) == 'SELECT')
        {
            if ($offset)
            {
                $sql .= " LIMIT " . (int) $offset . ", " . (int) $limit;
            }
            else
            {
                $sql .= " LIMIT " . (int) $limit;
            }
        }
        else if ($offset and strtoupper(substr(trim($sql), 0, 6)) == 'SELECT')
        {
            // @todo Should this be implemented...?
        }

        try {

            $res = $this->_conn->query($sql);

            if (!$res)
            {
                $errnum = -99;
                $errmsg = 'SQLLite Query Error';

                trigger_error('Error Num.: ' . $errnum . "\n" . 'Error Msg.:' . $errmsg . "\n" . 'SQL: ' . $sql, E_USER_ERROR);
                return false;
            }
        }
        catch(\Exception $e) {
            trigger_error($e->getMessage());
        }

        return $res;
    }
Query the database

@param string $sql
@return resource