$stmt = $dbh->prepare( qq |select * from x where y like ?| );
$stmt->bind_param( 1, 'foo%bar' );
$stm->execute;

The '%' is part of the actual bound parameter.....

    -klm.

----- Original Message ----- 
From: "Thomas Good" <[EMAIL PROTECTED]>
To: "DBI Users" <[EMAIL PROTECTED]>
Sent: Wednesday, May 28, 2003 10:31 AM
Subject: LIKE and Variable Binding


> Hi, how does one use LIKE and a wildcard with variable binding??
> 
> $q = qq |select * from x where y like ?|;
> ...
> $sth->execute($some_variable)
> 
> where does the % go??
> 
> TIA!
> 
> -----------------------------------------------------------------------
> Thomas Good                                  e-mail: [EMAIL PROTECTED]
> Programmer/Analyst                           phone:   (+1) 718.818.5528
> Residential Services                         fax:     (+1) 718.818.5056
> Behavioral Health Services, SVCMC-NY         mobile:  (+1) 917.282.7359
> 
> // Das ist die Kunst - wie man alles verhunzt.
> 
> 
> 

Reply via email to