Re: mysql_real_escape_string problem



On Sat, 05 Sep 2009 07:13:59 -0400, bill wrote:
I feed my $_POST variable through mysql_real_escape_string.
--------------------
<p>first line</p>
<p>second line</p>
---------------------

and mysql_real_escape_string
produces
-----------------
<p>first line</p>
\n
<p>second line</p>
-----------------

which obviously won't do.
stripslashes produces the more acceptable
--------------------
<p>first line</p>
<p>second line</p>
---------------------

Any suggestions, thoughts of this ?

But the \n is what you WANT for mysql. Otherwise the newline will go
away when the query is run.

--
Yes, Java is so bulletproofed that to a C programmer it feels like being in a
straightjacket, but it's a really comfy and warm straightjacket, and the world
would be a safer place if everyone was straightjacketed most of the time.
-- Mark 'Kamikaze' Hughes
.