Hi,
>
> i know this is not a direct EmbPerl question, but most of you
> fellow EmbPerl guys probably use DBI for database connectivity
> and might have an idea, is there a "cleaner" solution to do
> this thing:
>
> --- 8< ---
>
> $keyword=$dbh->quote($fdat{what});
> $keyword=~s/^\'//;
> $keyword=~s/\'$//;
> $sth=$dbh->prepare("SELECT ... FROM TABLE WHERE field like '%$keyword%'");
>
> --- 8< ---
>

Use placeholders...

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to