Bug #63631 [Com]: PDO_PGSQL: bindParam and bindValue not working
| From: | pretorian at km dot ru | Date: | Wed, 21 Aug 2013 09:36:08 +0000 |
| Subject: | Bug #63631 [Com]: PDO_PGSQL: bindParam and bindValue not working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-181087@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63631&edit=1
ID: 63631
Comment by: pretorian at km dot ru
Reported by: mamatkazin at spb dot orw dot ru
Summary: PDO_PGSQL: bindParam and bindValue not working
Status: Feedback
Type: Bug
Package: PDO related
Operating System: linux
PHP Version: 5.4.9
Block user comment: N
Private report: N
New Comment:
Test: version php 5.4.18
Code:
$stmt=$dbh->prepare(âquery_with_param_?â);
$stmt->bindParam(1, $param, PDO::PARAM_INT); // or bindValue
$stmt->execute();
$result=$stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_COLUMN);
Error in log:
(mod_fastcgi.c.2699) FastCGI-stderr: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid
input syntax for integer: "";
Error while executing the query (SQLExecute[7] at /tmp/php-5.4.18/ext/pdo_odbc/odbc_stmt.c:254)
Previous Comments:
------------------------------------------------------------------------
[2013-08-20 12:52:00] mike@php.net
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.
------------------------------------------------------------------------
[2012-11-28 07:31:41] mamatkazin at spb dot orw dot ru
Description:
------------
OS Linux, PHP 5.4.8 and 5.4.9, PostgreSQL 9.2.1,
Probably, bindParam and bindValue not working.
Code:
$stmt=$dbh->prepare(âquery_with_param_?â);
$stmt->bindParam(1, $param, PDO::PARAM_STR); // or bindValue
$stmt->execute();
$result=$stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_COLUMN);
Expected result:
$result - is not empty;
Actual result:
$result - empty
Test script:
---------------
$stmt=$dbh->prepare(âquery_with_param_?â);
$stmt->bindParam(1, $param, PDO::PARAM_STR); // or bindValue
$stmt->execute();
$result=$stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_COLUMN);
Expected result:
----------------
$result - is not empty;
Actual result:
--------------
$result - empty
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63631&edit=1