#35202 [Asn->Bgs]: errorCode() Returns String

From: Date: Sun, 13 Nov 2005 12:37:16 +0000
Subject: #35202 [Asn->Bgs]: errorCode() Returns String
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88090@lists.php.net to get a copy of this message
ID: 35202 Updated by: wez@php.net Reported By: lists at zaunere dot com -Status: Assigned +Status: Bogus Bug Type: PDO related Operating System: Windows XP PHP Version: 5.1.0RC4 Assigned To: wez New Comment: errorCode() returns a SQLSTATE string, as documented. Use errorInfo() to obtain driver specific error information. Previous Comments: ------------------------------------------------------------------------ [2005-11-12 20:13:41] helly@php.net SQL error codes are strings ------------------------------------------------------------------------ [2005-11-12 20:11:20] lists at zaunere dot com Description: ------------ The errorCode() method of both the PDO and PDOStatement objects return a string, rather than an integer, as documented. If there is no error, they return an empty string. Reproduce code: --------------- $stmt = $MyPDO->prepare('SELECT * FROM MyTable'); var_dump($stmt->errorCode()); Expected result: ---------------- int(0) Actual result: -------------- string(0) "" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35202&edit=1

« previous php.bugs (#88090) next »