You are here: Handling PDO Exceptions « PHP Programming Language « IT news, forums, messages
Handling PDO Exceptions

Posted by r_topor on 03/29/06 16:06

I'm just starting to use PDO for the first time under PHP 5.1. But
something doesn't work right in the following situation:

try {
$dbh = new PDO(...);
...
} catch (PDOException $e) {
print("Error!" . $e->getMessage());
die();
}

If an error occurs in constructing the new PDO instance, e.g., because
a wrong username/password, then the error is not printed. The
application just dies. PDO works fine on my installation when there
are no errors. What do I have to do to see the error message when a
PDO exception occurs in such a try/catch block?

Rodney

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация