ID: 36632 User updated by: gerwin84 at gmail dot com Reported By: gerwin84 at gmail dot com -Status: Feedback +Status: Open Bug Type: PDO related Operating System: WinXP Pro SP2 -PHP Version: 5.1.2 +PHP Version: 5.1.3RC4-dev New Comment:
With the latest windows version, 5.1.3RC4-dev Build Date Apr 21 2006 12:14:54, it is still not working. Exactly the same problem, with no differences. Previous Comments: ------------------------------------------------------------------------ [2006-04-21 04:10:45] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip ------------------------------------------------------------------------ [2006-03-06 17:12:55] gerwin84 at gmail dot com Description: ------------ Using the latest PHP windows package (PHP 5.1.3-dev from 19 feb.) PDO throws an PDOException with message 'SQLSTATE[]: <<Unknown error>>: 0' when executing an SQL statement (UPDATE or DELETE) where the WHERE restriction matches zero records in an MSAccess database. The following ext. are loaded in php.ini: extension=php_pdo.dll extension=php_pdo_odbc.dll Using php-cgi.exe and IIS Reproduce code: --------------- /* Table 'test' description: field 'user' text(50) | field 'role' text(50) */ $situation = 1; //value can be 1 or 2 $DBPath = "d:\\webroot\\database\\pdobug.mdb"; $MSAccessDB = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=".$DBPath.";"); $MSAccessDB->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $SQL1 = "INSERT INTO test VALUES( 'testuser','testrole');"; $SQL2 = "UPDATE test SET role='administrator' WHERE user='testuser' AND role='testrole';"; $SQL3 = "DELETE FROM test WHERE user='testuser';"; $MSAccessDB->exec($SQL1); switch($situation){ case 1: $MSAccessDB->exec($SQL2); //ok $MSAccessDB->exec($SQL2); //error break; case 2: $MSAccessDB->exec($SQL3); //ok $MSAccessDB->exec($SQL3); //error break; } Expected result: ---------------- a blank page as output and changes to the database log: - Always first a new row added. - In situation 1: the new row changed. - In situation 2: the new row deleted. Actual result: -------------- This is the error in in situation 1: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[]: <<Unknown error>>: 0 (SQLExecDirect[0] at ext\pdo_odbc\odbc_driver.c:230)' in D:\webroot\www\test\pdobug.php:20 Stack trace: #0 D:\webroot\www\test\pdobug.php(20): PDO->exec('UPDATE test SET...') #1 {main} thrown in D:\webroot\www\test\pdobug.php on line 20 The error in situation 2 is exacly the same, except line numbers etc. of course. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36632&edit=1