Re: mysql_real_escape_string problem
- From: "Peter H. Coffin" <hellsop@xxxxxxxxxxxxx>
- Date: Sat, 5 Sep 2009 07:32:19 -0500
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
.
- References:
- mysql_real_escape_string problem
- From: bill
- mysql_real_escape_string problem
- Prev by Date: Re: Firefox session continue after closing...
- Next by Date: Re: Credit card choice
- Previous by thread: mysql_real_escape_string problem
- Next by thread: Re: mysql_real_escape_string problem
- Index(es):