|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-24 15:26 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 17:00:02 2025 UTC |
Description: ------------ While constructing PDO object and trying to connect with database, in case something goes wrong, an exception is reportted. Everything is ok unless you want to display trace of exception or exception's object. In this case all required information for connecting with database are displayed. Reproduce code: --------------- catch (PDOException $e) { echo $e -> getTrace(); echo $e; } Expected result: ---------------- exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user: 'root@localhost' (Using password: YES)' in c:\htdocs\opb\opb\includes\main.php:146 Stack trace: #0 c:\htdocs\opb\opb\includes\main.php(146): PDO->__construct('mysql:dbname=op...', 'root', 'password') #1 c:\htdocs\opb\opb\index.php5(30): OPB->execute('index') #2 {main}