src/Ease/SQL/PDO.php
public function exeQuery($queryRaw, $ignoreErrors = false)
    {
        if (!isset($this->sqlLink) || is_null($this->sqlLink)) {
            $this->connect();
        }

        $queryRaw           = $this->sanitizeQuery($queryRaw);
        $this->lastQuery    = $queryRaw;
        $this->lastInsertID = null;
        $this->errorText    = null;
        $this->errorNumber  = null;
        $sqlAction          = trim(strtolower(current(explode(' ', $queryRaw))));

        switch ($sqlAction) {
            case 'select':
            case 'truncate':
            case 'show':
                $this->result      = $this->sqlLink->query($queryRaw);
                $this->errorNumber = $this->sqlLink->errorCode();
                $errorText         = $this->sqlLink->errorInfo();
                if ($this->errorNumber) {
                    $this->errorText = $errorText[2];
                }
                $this->logSqlError($ignoreErrors);

                if ($this->errorNumber == '00000') {
                    $this->numRows = $this->result->rowCount();
                }
                break;
            case 'insert':
                if (($this->dbType == 'pgsql') && !strstr(strtoupper($queryRaw),
                        'ON CONFLICT')) {
                    $queryRaw .= ' RETURNING '.$this->keyColumn;
                }
            case 'replace':
            case 'delete':
                $stmt              = $this->sqlLink->prepare($queryRaw);
                $stmt->execute();
                $this->errorNumber = $this->sqlLink->errorCode();
                $this->errorText   = $this->sqlLink->errorInfo();

                if (isset($this->errorText[2])) {
                    $this->addStatusMessage($this->errorText[2].': '.$queryRaw,
                        'error');
                }

                if ($this->errorText[0] == '0000') {
                    if (($this->dbType == 'pgsql') && (strstr($queryRaw,
                            strtoupper('RETURNING')))) {
                        $fetched = $stmt->fetch();
                        if (is_array($fetched)) {
                            $this->lastInsertID = current($fetched);
                        }
                    } else {
                        $this->lastInsertID = $this->getlastInsertID();
                    }
                    $this->numRows = $stmt->rowCount();
                    $this->result  = true;
                }
                break;
            case 'update':
                $stmt              = $this->sqlLink->prepare($queryRaw);
                $stmt->execute();
                $this->errorNumber = $this->sqlLink->errorCode();
                $errorText         = $this->sqlLink->errorInfo();
                if ($this->errorNumber) {
                    $this->errorText = $errorText[2];
                }
                $this->numRows = $stmt->rowCount();
                if (is_null($this->result)) {
                    $this->result = true;
                }
                break;
            case 'alter':
                $this->numRows = $stmt->rowCount();
                break;
            default:
                $this->numRows = null;
        }

        return $this->result;
    }
public function exeQuery($queryRaw, $ignoreErrors = false)
    {
        if (!isset($this->sqlLink) || is_null($this->sqlLink)) {
            $this->connect();
        }

        $queryRaw           = $this->sanitizeQuery($queryRaw);
        $this->lastQuery    = $queryRaw;
        $this->lastInsertID = null;
        $this->errorText    = null;
        $this->errorNumber  = null;
        $sqlAction          = trim(strtolower(current(explode(' ', $queryRaw))));

        switch ($sqlAction) {
            case 'select':
            case 'truncate':
            case 'show':
                $this->result      = $this->sqlLink->query($queryRaw);
                $this->errorNumber = $this->sqlLink->errorCode();
                $errorText         = $this->sqlLink->errorInfo();
                if ($this->errorNumber) {
                    $this->errorText = $errorText[2];
                }
                $this->logSqlError($ignoreErrors);

                if ($this->errorNumber == '00000') {
                    $this->numRows = $this->result->rowCount();
                }
                break;
            case 'insert':
                if (($this->dbType == 'pgsql') && !strstr(strtoupper($queryRaw),
                        'ON CONFLICT')) {
                    $queryRaw .= ' RETURNING '.$this->keyColumn;
                }
            case 'replace':
            case 'delete':
                $stmt              = $this->sqlLink->prepare($queryRaw);
                $stmt->execute();
                $this->errorNumber = $this->sqlLink->errorCode();
                $this->errorText   = $this->sqlLink->errorInfo();

                if (isset($this->errorText[2])) {
                    $this->addStatusMessage($this->errorText[2].': '.$queryRaw,
                        'error');
                }

                if ($this->errorText[0] == '0000') {
                    if (($this->dbType == 'pgsql') && (strstr($queryRaw,
                            strtoupper('RETURNING')))) {
                        $fetched = $stmt->fetch();
                        if (is_array($fetched)) {
                            $this->lastInsertID = current($fetched);
                        }
                    } else {
                        $this->lastInsertID = $this->getlastInsertID();
                    }
                    $this->numRows = $stmt->rowCount();
                    $this->result  = true;
                }
                break;
            case 'update':
                $stmt              = $this->sqlLink->prepare($queryRaw);
                $stmt->execute();
                $this->errorNumber = $this->sqlLink->errorCode();
                $errorText         = $this->sqlLink->errorInfo();
                if ($this->errorNumber) {
                    $this->errorText = $errorText[2];
                }
                $this->numRows = $stmt->rowCount();
                if (is_null($this->result)) {
                    $this->result = true;
                }
                break;
            case 'alter':
                $this->numRows = $stmt->rowCount();
                break;
            default:
                $this->numRows = null;
        }

        return $this->result;
    }
Vykoná QueryRaw a vrátí výsledek.

@param string $queryRaw
@param bool   $ignoreErrors

@return SQLhandle