php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56447 Error information is unable to be thrown.
Submitted: 2005-07-11 02:26 UTC Modified: 2005-07-11 08:52 UTC
From: noon at ms8 dot url dot com dot tw Assigned:
Status: Not a bug Package: PDO (PECL)
PHP Version: 5.0.3 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
40 - 22 = ?
Subscribe to this entry?

 
 [2005-07-11 02:26 UTC] noon at ms8 dot url dot com dot tw
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-11 08:52 UTC] wez@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PEAR.

Please try a PHP 5.1 snapshot.
 [2005-07-11 08:52 UTC] wez@php.net
from http://snaps.php.net/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC