-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
It looks like I get it working only with
PDO::ATTR_EMULATE_PREPARES => true
If the attribute is set to false , nothing is captured.
I try with a very simple script
<?php
$host = '0.0.0.0';
$db = 'xxx';
$user = 'xxx';
$pass = 'xxx';
$port = 3303;
$charset = 'utf8';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset;port=$port";
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,// does not work if set to true it works
];
try {
$pdo = new PDO($dsn, $user, $pass, $options);
$stmt = $pdo->query('SELECT NOW()');
while ($row = $stmt->fetch()){
var_dump($row);
}
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int)$e->getCode());dilyanbg
Metadata
Metadata
Assignees
Labels
No labels