Whoops...helps if I write it legally.
$dbStr = preg_replace("/'/", "/\\'/", $dbStr);
$dbStr = preg_replace("/'/", "/''/", $dbStr);
M
On Wed, 27 Feb 2002, Matt Drake wrote:
> I don't see why addslashes wouldn't work, but why not roll your own?
>
> $dbStr = preg_replace("/'/", "/\\'/");
>
> I be
I don't see why addslashes wouldn't work, but why not roll your own?
$dbStr = preg_replace("/'/", "/\\'/");
I believe that, in MySQL, you can also double-up single quotes to escape
them:
$dbStr = preg_replace("/'/", "/''/");
HTH
Matt
On Wed, 27 Feb 2002, Tim Thorburn wrote:
> Hi,
>
> I've se
Why isn't addslashes() working? You addslashes then you stripslashes()
:-)
Anyway, how about mysql_escape_string()?
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=66
3 matches
Mail list logo