php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63631 PDO_PGSQL: bindParam and bindValue not working
Submitted: 2012-11-28 07:31 UTC Modified: 2013-10-15 11:54 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: mamatkazin at spb dot orw dot ru Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.4.9 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-11-28 07:31 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-12 03:55 UTC] ssufficool@php.net
-Summary: bindParam and bindValue not working +Summary: PDO_PGSQL: bindParam and bindValue not working
 [2013-08-20 12:52 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2013-08-20 12:52 UTC] 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.



 [2013-08-21 09:36 UTC] pretorian at km dot ru
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)
 [2013-08-21 10:01 UTC] mike@php.net
1.) Please provide a complete reproduce script.
2.) Now is that about PDO_PGSQL or PDO_ODBC? Your subject differs from the error 
message...
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 02:01:29 2024 UTC