src/Readdle/Database/FQDBExecutor.php
private function _getWarnings($sqlQueryString, $options = [])
    {
        if ($this->_databaseServer === self::DB_MYSQL) {
            $stm = $this->_pdo->query('SHOW WARNINGS');
            $sqlWarnings = $stm->fetchAll(\PDO::FETCH_ASSOC);
        } else {
            $sqlWarnings = [['Message' => 'WarningReporting not impl. for ' . $this->_pdo->getAttribute(\PDO::ATTR_DRIVER_NAME)]];
        }


        if (count($sqlWarnings) > 0) {
            $warnings = "Query:\n{$sqlQueryString}\n";

            if (!empty($options)) {
                $warnings .= "Params: (";

                foreach ($options as $key => $value) {
                    $warnings .= $key . '=' . json_encode($value) . ', ';
                }

                $warnings = substr($warnings, 0, -2) . ")\n";
            }


            $warnings .= "Produced Warnings:";

            foreach ($sqlWarnings as $warn) {
                $warnings .= "\n* " . $warn['Message'];
            }

            return $warnings;
        }

        return '';
    }
private function _getWarnings($sqlQueryString, $options = [])
    {
        if ($this->_databaseServer === self::DB_MYSQL) {
            $stm = $this->_pdo->query('SHOW WARNINGS');
            $sqlWarnings = $stm->fetchAll(\PDO::FETCH_ASSOC);
        } else {
            $sqlWarnings = [['Message' => 'WarningReporting not impl. for ' . $this->_pdo->getAttribute(\PDO::ATTR_DRIVER_NAME)]];
        }


        if (count($sqlWarnings) > 0) {
            $warnings = "Query:\n{$sqlQueryString}\n";

            if (!empty($options)) {
                $warnings .= "Params: (";

                foreach ($options as $key => $value) {
                    $warnings .= $key . '=' . json_encode($value) . ', ';
                }

                $warnings = substr($warnings, 0, -2) . ")\n";
            }


            $warnings .= "Produced Warnings:";

            foreach ($sqlWarnings as $warn) {
                $warnings .= "\n* " . $warn['Message'];
            }

            return $warnings;
        }

        return '';
    }
private function _getWarnings ( $ sqlQueryString , $ options = [ ] ) { if ( $ this -> _databaseServer === self :: DB_MYSQL ) { $ stm = $ this -> _pdo -> query ( 'SHOW WARNINGS' ) ; $ sqlWarnings = $ stm -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; } else { $ sqlWarnings = [ [ 'Message' => 'WarningReporting not impl. for ' . $ this -> _pdo -> getAttribute ( \ PDO :: ATTR_DRIVER_NAME ) ] ] ; } if ( count ( $ sqlWarnings ) > 0 ) { $ warnings = "Query:\n{$sqlQueryString}\n" ; if ( ! empty ( $ options ) ) { $ warnings .= "Params: (" ; foreach ( $ options as $ key => $ value ) { $ warnings .= $ key . '=' . json_encode ( $ value ) . ', ' ; } $ warnings = substr ( $ warnings , 0 , - 2 ) . ")\n" ; } $ warnings .= "Produced Warnings:" ; foreach ( $ sqlWarnings as $ warn ) { $ warnings .= "\n* " . $ warn [ 'Message' ] ; } return $ warnings ; } return '' ; }
gathers Warning info from \PDO
@param string $sqlQueryString SQL query string with placeholders
@param array $options options passed to query
@return string
gathers Warning info from \ PDO