|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56461 PDO MSSQL errorInfo()
Submitted: 2005-07-22 14:28 UTC Modified: 2006-02-27 07:23 UTC
From: mlmoura at fitec dot org dot br Assigned:
Status: No Feedback Package: PDO (PECL)
PHP Version: 5_0 CVS-2005-07-22 (dev) 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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
48 + 50 = ?
Subscribe to this entry?

 [2005-07-22 14:28 UTC] mlmoura at fitec dot org dot br
I?m trying to use the PDO package with php_pdo.dll and php_pdo_mssql.dll, the files have been downloaded today from the PECL?s site.
The extensions was correctlly enabled in the php.ini.
The bug is: when a sql error occurs and the error info is required.

Reproduce code:
$dsn = 'mssql:dbname=test;host=localhost';
$user = 'sa';
$password = 'sa';
try {
   $dbh = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
/* Provoke an error -- the BONES table does not exist */
$err = $dbh->prepare('SELECT skull FROM bones');
echo "\nPDO::errorInfo():\n";

Expected result:
Example was extract from manual of the

Something like that, except that I?m using the Sql Server and example show an error of DB2:

    [0] => 42S02
    [1] => -204
    [2] => [IBM][CLI Driver][DB2/LINUX] SQL0204N  "DANIELS.BONES" is an undefined name.  SQLSTATE=42704

Actual result:
The Apache crashes with the Windows message: 
"Apache HTTP Server has encountered a problem and needs to close.  We are sorry for the inconvenience."
Terminates without any response from the browser.

The tests was executed using more then one version of Apache and Php.

Obs: If I use the errorCode() method instead of errorInfo() the browser returns with this code: HY000. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-30 23:28 UTC]
Please try a 5.1 snapshot from
 [2006-02-27 07:23 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 18:03:40 2021 UTC