mysqli::real_escape_string creates \r\n problems?
Posted on 2014-01-08
I have a form where the users use TinyMCE to fill out some information, and that form is then POSTed, and stored in a database.
The problem appears to be that mysqli::real_escape_string is turning carriage return line feeds into escaped versions of themselves, and storing them. Well... that is part of the design. But when I re-read the database, and run stripslashes() on the data as it is read from the DB, I get output like this:
Here si some good HTML code
But you can see
that there are annoying
"rn" on blank lines between everything.
How can I store HTML in the DB, and retrieve it without having this \r\n problem?