openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit f6b29badc5081a19b358859ad9289b9975b6b68e
parent 138b46019e3ccae25e0e63e1ff49d0fdf258e940
Author: Jan Dankert <devnull@localhost>
Date:   Sun,  3 Dec 2017 23:49:31 +0100

Kein Emulieren von Prepared-Statements, wenn nicht notwendig. Ziel: Integer sollten auch als Integer angekommen.

Diffstat:
modules/database/driver/pdo.class.php | 29+++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/modules/database/driver/pdo.class.php b/modules/database/driver/pdo.class.php @@ -64,9 +64,17 @@ class DB_pdo if ( $conf['persistent']) $options[ PDO::ATTR_PERSISTENT ] = true; - if ( !$conf['prepare']) - $options[ PDO::ATTR_EMULATE_PREPARES ] = true; + //if ( !$conf['prepare']) <- unused... + // From the docs: + // try to use native prepared statements (if FALSE). + // It will always fall back to emulating the prepared statement if the driver cannot successfully prepare the current query + $options[ PDO::ATTR_EMULATE_PREPARES ] = false; + // Convert numeric values to strings when fetching => NO + $options[ PDO::ATTR_STRINGIFY_FETCHES ] = false; + $options[ PDO::ATTR_AUTOCOMMIT ] = false; + + // We like Exceptions $options[ PDO::ERRMODE_EXCEPTION ] = true; $options[ PDO::ATTR_DEFAULT_FETCH_MODE ] = PDO::FETCH_ASSOC; @@ -105,6 +113,23 @@ class DB_pdo { $row = $this->stmt->fetch( PDO::FETCH_ASSOC ); +/* + * + + + if(intval(@$row['id'])==1) + { + echo "Hallo:"; + +// echo "\n";print_r($row)."\n"; + var_dump($row); + echo " ist... ".gettype($row); + + } + + */ + + if ( is_array($row) && $this->lowercase ) $row = array_change_key_case($row);