|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-11 08:52 UTC] wez@php.net
[2005-07-11 08:52 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 07:00:01 2025 UTC |
Description: ------------ Scripts will terminate (immediately) when an error occured while accessing databases. Reproduce code: --------------- <?php class xPDO { public static $pdo; public function connect () { $dsn = 'mssql:host=127.0.0.1; dbname=mydb'; $user = 'error_user'; $password = 'error_passwd'; try { $this->pdo = new PDO($dsn, $user, $password); } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); } } } $a = new xPDO(); $a->connect(); ?> Expected result: ---------------- The statement is excuted normally and throws error information. Actual result: -------------- script crash