Io non riesco a ottenere qualsiasi messaggio di errore da PDO:Come spremere il messaggio di errore da PDO?
#$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
try {
$sth = $dbh->prepare('@$%T$!!!');
print_r($sth);
print_r($dbh->errorInfo());
} catch (PDOException $e) {
echo $e->getMessage();
}
Si sta dando solo:
PDOStatement Object
(
[queryString] => @$%T$!!!
)
Array
(
[0] => 00000
[1] =>
[2] =>
)
setAttribute non aiuta nulla.
E 'PHP 5.3.3 Apache 2.0 Handler
DOP driver per MySQL abilitato
client versione API mysqlnd 5.0.7-dev - 091.210 - $ Revision: 300.533 $
Che cosa posso fare per ottenere informazioni sugli errori ?
Cosa viene stampato 'print_r ($ sth-> errorInfo())'? – shamittomar
@shamittomar L'ho provato anche io, distribuendo una serie di 3 elementi vuoti –