Bug #51724 [NEW]: int PDO::exec ( string $statement )
| From: | jerck at rocware dot com | Date: | Mon, 03 May 2010 01:26:33 +0000 |
| Subject: | Bug #51724 [NEW]: int PDO::exec ( string $statement ) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-150109@lists.php.net to get a copy of this message | ||
From:
Operating system: Mac OS X 10.5.8
PHP version: 5.2SVN-2010-05-03 (SVN)
Package: PDO related
Bug Type: Bug
Bug description:int PDO::exec ( string $statement )
Description:
------------
Explained succinctly in "test script" text area below...
<?php
// Back ticks do not adversely affect SQL. It runs without error.
$sql = "
UPDATE
Business
SET Business.Phone = '1 (612) 986-6874'
WHERE Business.BusinessID = 1
LIMIT 1";
$count = DB::I()->exec($sql); // Singleton PDO DB handle
echo($count); // prints 0 of type integer
/**
* $count should evaluate to the integer 1, not to 0.
* Thoughts?
**/
?>
Test script:
---------------
<?php
// Back ticks do not adversely affect SQL. It runs without error.
$sql = "
UPDATE Business
SET Business.Phone = '1 (612) 986-6874'
WHERE Business.BusinessID = 1
LIMIT 1";
$count = DB::I()->exec($sql); // Singleton PDO DB handle
echo($count); // prints 0 of type integer
/**
* $count should evaluate to the integer 1, not to 0.
* Thoughts?
**/
?>
Expected result:
----------------
echo($count); // Should print the integer 1
Actual result:
--------------
echo($count); // Currently prints the integer 0 even though the database is
successfully updating 1 record
--
Edit bug report at http://bugs.php.net/bug.php?id=51724&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51724&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51724&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51724&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51724&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51724&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51724&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51724&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51724&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51724&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51724&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51724&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51724&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51724&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51724&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51724&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51724&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51724&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51724&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51724&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51724&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51724&r=mysqlcfg