-
mysql question
Need help...
I have stored a formatted text content of three paragraphs long into a field of type TEXT.
When I retrieve the text content from the MySQL database using a PHP script and have it displayed on a HTML, I get a continuous text instead of three paragraphs of text.
Any ideas on how I can display the text properly? Thanks. :)
-
Yup. MySQL doesn't care what a carriage return is. The way I got around that is I used PHP to search for the carriage return character (I think it was '\n', or perhaps '\r\n') and replaced it with a tag. There is probably a cleaner way to do this, but this method worked for me. Good luck, and let me know what you use.
-
Found the PHP code I used to search for carriage returns in a string and replace them with
or
tag:
PHP Code:
$mystring = preg_replace("/\r\n|\n\r|\n|\r/", "
", $mystring);
Hope that works for you
-
thanks roswell1329
Thanks for the help, will check it out. :)