|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-11-07 10:00 UTC] felipe@php.net
[2008-11-15 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 14:00:01 2025 UTC |
Description: ------------ using PDO->prepare if I create a string like 'select * from foo match (column) against (":var");' and then call execute(array(":var"=>"value"); I get a select that does not get the :var replaced. If I move the quotes to the variable string: e.g. 'select * from foo match (column) against (:var);' and then call execute(array(":var"=>"\"value\""); it works fine. Reproduce code: --------------- global $pdo,$mRequest; //$mRequest = $pdo->prepare($movieQuery); if (!$mRequest) { $mRequest = $pdo->prepare('select ":title",nflx_data.movieid,nflx_data.url,match (title) against (":title") as rank from nflx_data where match (title) against (":title") order by rank desc limit 1'); } $mRequest->execute(Array(':title'=>$title)); $result = $mRequest->fetch(PDO::FETCH_ASSOC); $mRequest->closeCursor(); print_r($result); Expected result: ---------------- I expect to get different results based on the value of $title being inserted at each instance of :title. Actual result: -------------- Array ( [movieid] => 20557937 [:title] => :title [url] => ... )