Bitte mal unverändert
PHP-Code:
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
echo 'version: ', phpversion(), "<br />\n";
try {
throw new Exception('test1');
}
catch(Exception $e) {
echo 'exception: ', $e->getMessage(), ' ', $e->getCode();
}
echo ".<br />\n";
try {
$dbh = new PDO('mysql:ungueltig', '1', '2');
}
catch(PDOException $e) {
echo 'exception: ', $e->getMessage(), ' ', $e->getCode();
}
echo ".<br />\n";
try {
$dbh = new PDO('sqlite:foo.db');
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$dbh->query('xyz');
}
catch(PDOException $e) {
echo 'exception: ', $e->getMessage(), ' ', $e->getCode();
}
echo ".<br />\n";
ausprobieren. Was wird ausgegeben?