Bug #48877 [Asn->Csd]: "bindValue" and "bindParam" do not work for PDO Firebird
| From: | mariuz@php.net | Date: | Sat, 10 Dec 2011 22:20:51 +0000 |
| Subject: | Bug #48877 [Asn->Csd]: "bindValue" and "bindParam" do not work for PDO Firebird | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165797@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=48877&edit=1
ID: 48877
Updated by: mariuz@php.net
Reported by: siegmar at siegmar dot com dot br
Summary: "bindValue" and "bindParam" do not work for PDO
Firebird
-Status: Assigned
+Status: Closed
Type: Bug
Package: PDO related
Operating System: Windows
PHP Version: 5.2.10
Assigned To: mariuz
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2011-12-10 22:09:41] mariuz@php.net
Automatic comment from SVN on behalf of mariuz
Revision: http://svn.php.net/viewvc/?view=revision&revision=320856
Log: bug fixed #48877 - bindValue and bindParam do not work for PDO Firebird
------------------------------------------------------------------------
[2011-12-10 22:08:20] mariuz@php.net
Automatic comment from SVN on behalf of mariuz
Revision: http://svn.php.net/viewvc/?view=revision&revision=320855
Log: bug fixed #48877 - bindValue and bindParam do not work for PDO Firebird
------------------------------------------------------------------------
[2011-12-10 22:04:04] mariuz@php.net
Automatic comment from SVN on behalf of mariuz
Revision: http://svn.php.net/viewvc/?view=revision&revision=320854
Log: bug fixed #48877 - bindValue and bindParam do not work for PDO Firebird
------------------------------------------------------------------------
[2010-07-04 05:14:44] ssufficool at gmail dot com
Try changing the :empno to just empno in bind* it is not expected or needed:
$command = $connection->prepare('SELECT EMP_NO FROM EMPLOYEE WHERE EMP_NO = :empno');
$command->bindParam('empno', $value, PDO::PARAM_STR); // does not work
$command->bindValue('empno', $value, PDO::PARAM_STR); // does not work
------------------------------------------------------------------------
[2009-07-10 02:35:29] siegmar at siegmar dot com dot br
Description:
------------
The "bindValue" and "bindParam" do not work for PDO Firebird if we use named
parameters (:parameter) but do work for question marks parameters (?).
Reproduce code:
---------------
<?php
$connection = new PDO('firebird:dbname=localhost:C:\Firebird\EMPLOYEE.FDB',
'SYSDBA', 'masterkey');
$value = '2';
//$command = $connection->prepare('SELECT EMP_NO FROM EMPLOYEE WHERE EMP_NO = :empno');
//$command->bindParam(':empno', $value, PDO::PARAM_STR); // does not work
//$command->bindValue(':empno', $value, PDO::PARAM_STR); // does not work
$command = $connection->prepare('SELECT EMP_NO FROM EMPLOYEE WHERE EMP_NO = ?');
$command->bindParam('1', $value, PDO::PARAM_STR); // works
//$command->bindValue('1', $value, PDO::PARAM_STR); // works
$command->execute();
$dataset = $command->fetchAll();
foreach($dataset as $record)
echo $record[0] . "<br />";
?>
The same code works perfectly for MySQL.
Expected result:
----------------
Using the example database "EMPLOYEE.FDB" you sould see:
2
Actual result:
--------------
nothing
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=48877&edit=1