|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-30 23:28 UTC] wez@php.net
[2006-02-27 07:23 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 06:00:01 2025 UTC |
Description: ------------ 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: --------------- <?php $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'); $err->execute(); echo "\nPDO::errorInfo():\n"; print_r($err->errorInfo()); ?> Expected result: ---------------- Example was extract from manual of the php.net Something like that, except that I?m using the Sql Server and example show an error of DB2: PDO::errorInfo(): Array ( [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.