ID:               36281
 Updated by:       [EMAIL PROTECTED]
 Reported By:      vendor at visv dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: Linux
 PHP Version:      5.1.2
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip




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

[2006-02-04 05:35:05] vendor at visv dot net

Description:
------------
$q = "SELECT id, name FROM test WHERE name like '%:foo%';
$s = "carrot";

$dbh = new PDO('mysql:...', $user, $pass);

$sth = $dbh->prepare($q);
$sth->bindParam(':foo', $s);
$sth->execute()

while ($r = $sth->fetch()) {
    print_r($r);
}

the above does not work. Adding PDO::PARAM_STR, and the
length argument do not help matters.

simply embedding $s in place of :foo does work. It also
works fine if I leave off the "'%" and "%'" parts
and $s == the column value. It just seems bindParam()
cannot cope with the '% %' parts in the query.

I do not find similar in your bugtracking system, nor
in user supplied notes (currently there are none).

Thanks.


Reproduce code:
---------------
See description.



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


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

Reply via email to