On Mon, Apr 09, 2001 at 06:01:19PM +0200, Nicolas JOURDEN wrote:
> Hi,
> 
> I've got an problem develloping a research tool...
> 
> Well, using quote param ($dbh->quote (string); )...
> 
> I would like to get juste that :
> va\nukl\sjj
> 
> But using that one it's return :
> 'va\nukl\sjj'
> 
> How to cancel the ' and ' at the top of the return string and at the end ?

But that's the whole point of calling quote()...  :)


> Just for information I do a LIKE reuquest :
> 
> $dbh->prepare("SELECT foo FROM bar WHERE fore LIKE '%". $dbh->quote( 
> $string ). "%'";
> 

Try this instead:

  $sth = $dbh->prepare("SELECT foo FROM bar WHERE fore LIKE " .
                       $dbh->quote("%$string%"));

Or, with placeholders:

  $sth = $dbh->prepare("SELECT foo FROM bar WHERE fore LIKE ?");
  $sth->execute("%$string%");


Ronald

Reply via email to