|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2009-08-06 06:39 UTC] bjori@php.net
  [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 02:00:02 2025 UTC | 
Description: ------------ PDO doesn't throw any exception (at least with Oracle) in some cases but I can see the error with $db->errorInfo(). I notice this happens when I bind some unexistent variables to the query. I know it is wrong (bind unexistent variables) but in my opinion PDO must throw an exception (because $db->errorInfo() knows the error) Reproduce code: --------------- // create table TBLDUMMY (FIELD1 VARCHAR2(2), FIELD2 VARCHAR2(2)) $db = new PDO( $dsn, // my DB dsn $user, // database username $password); // database password try { $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "select FIELD1, FIELD2 FROM TBLDUMMY"; //$sqlOK = "select FIELD1, FIELD2 FROM TBLDUMMY WHERE FIELD1=:F1"; $stmt = $db->prepare($sql); $stmt->execute(array('F1' => '1')); $result = $stmt->fetchAll(); echo "<pre>"; print_r($db->errorInfo()); echo "</pre>"; } catch (Exception $e) { echo "Exception:" . $e->getMessage(); } Expected result: ---------------- Exception OCIBindByName: ORA-01036: n?mero/nombre de variable no v?lido Actual result: -------------- Array ( [0] => HY000 [1] => 1036 [2] => OCIBindByName: ORA-01036: n?mero/nombre de variable no v?lido (/usr/local/PDO_OCI-1.0/oci_statement.c:287) )