ID:               37937
 User updated by:  ibexris at gmail dot com
 Reported By:      ibexris at gmail dot com
 Status:           Open
 Bug Type:         MySQLi related
 Operating System: linux, fedora core 5
 PHP Version:      5.1.4
 New Comment:

Further digging shows that there are also hidden characters returned
from the query, and that they often change between executions of the
code.


Previous Comments:
------------------------------------------------------------------------

[2006-06-27 20:27:35] ibexris at gmail dot com

Description:
------------
Like the summary says...  using a bound parameter inside of a CONCAT()
produces strange results.

Reproduce code:
---------------
<?php

$dbh = mysqli_init();
$dbh->real_connect('localhost', 'dbuser', '', 'dbname');

$sh = $dbh->prepare('SELECT CONCAT("xxx", ?, "xxx"), CONCAT("xxx",
"abc", "xxx")');

$sh->bind_param('s', $x);
$sh->bind_result($r, $r2);

$x = 'abc';

$sh->execute();
$sh->fetch();

echo "\n$r\n$r2\n\n";

$dbh->close();

Expected result:
----------------
xxxabcxxx
xxxabcxxx

Actual result:
--------------
On my system, this prints out:

xxxabcxA
xxxabcxxx

The "A" changes on other systems (or goes away).  However, both lines
*should* be the same. Change the x's around in the first field and
watch the results get even stranger, or remove them completely to have
it work as expected (except that I need the CONCAT for my query).



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37937&edit=1

Reply via email to