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
 [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

Pull Requests

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: Sat Dec 21 14:01:32 2024 UTC