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: 2009-06-12 21:08 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:
Status: Open Package: PDO_INFORMIX (PECL)
PHP Version: 5.2.6 OS: Ubuntu 8.10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 04:01:26 2019 UTC