Forum Moderators: coopster

Message Too Old, No Replies

PDO prepare not outputting any result

         

phparion

8:18 pm on Jun 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi,

I am using following code


$sth = $dbh->prepare("SELECT *
FROM qna
WHERE q LIKE '%:qu%'");
$quo = "what";
$sth->bindParam(':qu', $quo, PDO::PARAM_STR,4);

$sth->execute();

$result = $sth->fetchAll();
print_r($result);

it is giving me EMPTY array

Array()

as an output

while if I execute the same array with replacing :qu with "what" word it shows me all fetched records.

Can anybody guess where am I doing wrong?

thank you!

newb2seo

3:16 pm on Jun 25, 2009 (gmt 0)