MySQL and new lines

M

Mark Adkins

Hi,

So I was having trouble earlier with getting MySQL to accept single
quotes from a textarea, but I got that resolved using both the MySQL
escape_string and the CGI escape method (I finally settled on the
escape_string), and that's taken care of that problem.

However, I can't seem to figure out how to keep newlines that are
inserted by users? I've looked around on Google and can't seem to find
any answers. I've tried gsub to replace the \n with a \n<br /> (I saw
that method employed with PHP's str_replace, but no luck here).

Any other suggestions or solutions?

Thanks a lot,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,283
Messages
2,571,407
Members
48,101
Latest member
LinetteDeg

Latest Threads

Top