php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58598 pdo_informix bindValue(...) does not work correctly
Submitted: 2009-03-25 14:24 UTC Modified: 2021-09-19 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sahib dot alejandro at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: PDO_INFORMIX (PECL)
PHP Version: 5.2.6 OS: Ubuntu 8.10
Private report: No CVE-ID: None
 [2009-03-25 14:24 UTC] sahib dot alejandro at gmail dot com
Description:
------------
PDO_INFORMIX bindValue(...) or bindParam(...) does not work as expected, there is no diference using prepare(...) with a direct sql query or a stored procedure query.
It seems the binded value lose their value and if you're using these value in the WHERE clause then always fail the condition.

Configuration:
Ubuntu 8.10
Apache/2.2.9 (Ubuntu) PHP/5.2.6-2ubuntu4.1 with Suhosin-Patch
Informix CSDK 3.50 UC.3DE.Linux
IBM Informix Dynamic Server Version 10.00.FC4
PDO_INFORMIX driver 1.2.6

Reproduce code:
---------------
mypdo1.php [using bindValue(...), DON'T WORK]
<?
$Pdo = new PDO('informix: host=myhost; server=myserver; protocol=onsoctcp; service=11000; database=empleados', 'user', 'password');
$Stmt = $Pdo->prepare('EXECUTE PROCEDURE test(?)');
$Stmt->bindValue(1, $sString);
$sString = "myString";
$Stmt->execute();
$aRow = $Stmt->fetch(PDO::FETCH_NUM);
echo '<pre>'; var_dump($aRow); echo '</pre>';
?>

mypdo2.php [using direct value in sql query, IT WORK]
<?
$Pdo = new PDO('informix: host=myhost; server=myserver; protocol=onsoctcp; service=11000; database=empleados', 'user', 'password');
$Stmt = $Pdo->prepare('EXECUTE PROCEDURE test("myString")');
$Stmt->execute();
$aRow = $Stmt->fetch(PDO::FETCH_NUM);
echo '<pre>'; var_dump($aRow); echo '</pre>';
?>

Expected result:
----------------
Same result in both scripts
array(2) {
  [0]=>
  string(9) "JARAMILLO"
  [1]=>
  string(3) "LEO"
}

Actual result:
--------------
mypdo1.php
array(2) {
  [0]=>
  NULL
  [1]=>
  NULL
}

mypdo2.php
array(2) {
  [0]=>
  string(9) "JARAMILLO"
  [1]=>
  string(3) "LEO"
}

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-25 15:32 UTC] sahib dot alejandro at gmail dot com
sorry there is "bindValue(...)" at the title, finger mistake.
 [2009-03-27 04:36 UTC] pierre dot php at gmail dot com
informix bug.
 [2009-04-03 11:32 UTC] sahib dot alejandro at gmail dot com
then there is not solution? =(

In the RedBooks documents from IBM show some examples and use prepare and bindParam, and it supose to work...

Why IBM release a documentation that "has a BUG"?

I think the solution exists, I'll keep testing...
 [2009-06-12 21:08 UTC] kalle@php.net
Reclassified
 [2021-09-04 10:11 UTC] mekristin8 at gmail dot com
The following pull request has been associated:

Patch Name: Output entire file path
On GitHub:  https://github.com/php/doc-base/pull/40
Patch:      https://github.com/php/doc-base/pull/40.patch
 [2021-09-09 13:39 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-09 13:39 UTC] cmb@php.net
Is this still an issue with latest PDO_INFORMIX (1.3.4)?
 [2021-09-19 04:22 UTC] pecl-dev 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: Fri Dec 27 01:01:28 2024 UTC