getAllErrorMessages example

if ($this->connID !== false) {
            // Determine how identifiers are escaped             $query = $this->query('SELECT CASE WHEN (@@OPTIONS | 256) = @@OPTIONS THEN 1 ELSE 0 END AS qi');
            $query = $query->getResultObject();

            $this->_quoted_identifier = empty($query) ? false : (bool) $query[0]->qi;
            $this->escapeChar         = ($this->_quoted_identifier) ? '"' : ['[', ']'];

            return $this->connID;
        }

        throw new DatabaseException($this->getAllErrorMessages());
    }

    /** * For exception message * * @internal */
    public function getAllErrorMessages(): string
    {
        $errors = [];

        

        // Prepare parameters for the query         $queryString = $this->getQueryString();

        $parameters = $this->parameterize($queryString);

        // Prepare the query         $this->statement = sqlsrv_prepare($this->db->connID, $sql$parameters);

        if ($this->statement) {
            if ($this->db->DBDebug) {
                throw new DatabaseException($this->db->getAllErrorMessages());
            }

            $info              = $this->db->error();
            $this->errorCode   = $info['code'];
            $this->errorString = $info['message'];
        }

        return $this;
    }

    /** * Takes a new set of data and runs it against the currently * prepared query. */
Home | Imprint | This part of the site doesn't use cookies.