php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57496 bindValue/Params don't work when linked with libmysqlclient14 / libmysqlclient15
Submitted: 2007-01-27 08:22 UTC Modified: 2011-05-26 08:20 UTC
From: dpobel at free dot fr Assigned:
Status: No Feedback Package: PDO_MYSQL (PECL)
PHP Version: 5.1.6 OS: Ubuntu Edgy Eft
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dpobel at free dot fr
New email:
PHP Version: OS:

 

 [2007-01-27 08:22 UTC] dpobel at free dot fr
Description:
------------
It seems that prepared statements with bindValue (or bindParams) don't work as expected. The two examples below should output the same things.

Configuration : 
PHP 5.1.6 (ubuntu package)
MySQL 4.1.15 (ubuntu package)
PDO_MYSQL compiled with libmysqlclient14-dev (header for MySQL 4.1) and libmysqlclient15-dev (header for MySQL 5.0) with the same result.

Reproduce code:
---------------
test_pdo.php
<?php
$db = new PDO('mysql:host=localhost;dbname=sew', LOGIN, PASSWORD);
$stmt = $db->prepare('select * from `sew_sites` where `id`=:id');
$stmt->bindValue(':id', 1);
$stmt->execute();
$row = $stmt->fetchAll( PDO::FETCH_ASSOC );
var_dump($row);
$stmt->closeCursor();
?>

test_pdo_simple.php
<?php
$db = new PDO('mysql:host=localhost;dbname=sew', LOGIN, PASSWORD);
$stmt = $db->prepare('select * from `sew_sites` where `id`=1');
$stmt->execute();
$row = $stmt->fetchAll( PDO::FETCH_ASSOC );
var_dump($row);
$stmt->closeCursor();
?>

Expected result:
----------------
These two scripts should output exactly same data.

Actual result:
--------------
> tigrou@dedipwet[88.191.30.29]:~/tmp$ php5 test_pdo.php 
array(0) {
}
> tigrou@dedipwet[88.191.30.29]:~/tmp$ php5 test_pdo_simple.php 
array(1) {
  [0]=>
  array(4) {
    ["id"]=>
    string(1) "1"
    ["title"]=>
    string(15) "~tigrou/pwet.fr"
    ["url"]=>
    string(14) "http://pwet.fr"
    ["pages"]=>
    string(5) "60000"
  }
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-29 17:44 UTC] dpobel at free dot fr
If I compiled PDO_MYSQL with libmysqlclient12-dev (header for MySQL 4.0), it works correctly... don't know if it's a PDO problem or a Ubuntu package problem ?
 [2008-05-13 09:00 UTC] johannes at schlueters dot de
Could you please try with newer versions. Thanks.
 [2011-05-26 08:20 UTC] johannes at schlueters dot de
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 "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC