Bug #51724 [Opn->Fbk]: int PDO::exec ( string $statement )
| From: | pierrick@php.net | Date: | Mon, 03 May 2010 13:26:33 +0000 |
| Subject: | Bug #51724 [Opn->Fbk]: int PDO::exec ( string $statement ) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150119@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51724&edit=1
ID: 51724
Updated by: pierrick@php.net
Reported by: jerck at rocware dot com
Summary: int PDO::exec ( string $statement )
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO related
Operating System: Mac OS X 10.5.8
PHP Version: 5.2SVN-2010-05-03 (SVN)
New Comment:
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
It seems to work properly.
Could you try to execute the following statement before executing your
script to
make sure that the row you're trying to modify will really be affected
by your
query.
UPDATE
Business SET Business.Phone = '' WHERE
Business.BusinessID = 1
Previous Comments:
------------------------------------------------------------------------
[2010-05-03 03:26:32] jerck at rocware dot com
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 this bug report at http://bugs.php.net/bug.php?id=51724&edit=1