ID: 46007 User updated by: aragon at phat dot za dot net Reported By: aragon at phat dot za dot net -Status: Feedback +Status: Open Bug Type: PDO related Operating System: FreeBSD 7.0-STABLE PHP Version: 5.2.6 New Comment:
Just tried the latest snapshot. It appears to be fixed. Thanks a million! Previous Comments: ------------------------------------------------------------------------ [2008-10-28 22:09:53] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ ------------------------------------------------------------------------ [2008-09-06 05:45:07] aragon at phat dot za dot net Description: ------------ When executing an UPDATE query to a SQLite3 database, PDOStatement::rowCount() and PDO:exec() returns 0 instead of 1 or more when rows are updated in the database. Reproduce code: --------------- $db = new PDO('sqlite:crnl.db'); // PDO::exec() example $sql = 'SELECT tags FROM blog_entries WHERE docid = 1'; $statement = $db->query($sql); $row = $statement->fetch(); echo $row[0], "\n"; $sql = 'UPDATE blog_entries SET tags = \'test\' WHERE docid = 1'; echo $db->exec($sql), "\n"; $sql = 'SELECT tags FROM blog_entries WHERE docid = 1'; $statement = $db->query($sql); $row = $statement->fetch(); echo $row[0], "\n"; // PDO:rowCount() example $sql = 'UPDATE blog_entries SET tags = \'untest\' WHERE docid = 1'; echo $db->query($sql)->rowCount(), "\n"; $sql = 'SELECT tags FROM blog_entries WHERE docid = 1'; $statement = $db->query($sql); $row = $statement->fetch(); echo $row[0], "\n"; Expected result: ---------------- untest 1 test 1 untest Actual result: -------------- untest 0 test 0 untest ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46007&edit=1