If you are using DBI to access MySQL then something like this may be better.
use DBI; my $dbh=DBI->connect('DSN info here'); my $string="D'ith"; my $val_to_put_in_mysql=$dbh->quote($string);
Or if you are using placeholders in your query then DBI will do the quote on insert for you. Either way DBI will fetch it back as D'ith for you.
In reply to Re: Re: Re: Escaping a string
by dga
in thread Escaping a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |