Hi all
I am insert a paragraph in a mysql database table and the datatype of the column is 'text'. But when i retrieve the value from the database and display it on a page, it's not preserving the new line. Its displaying everything without any line breaks
Can anybody help
Thanx
IM

    I imagine that you are dumping the data from the DB into the browser window. And actually, the browser is very aware that there are newlines in the copy, but it does not recognize the newline as valid HTML markup, and ignores it.

    If you were to view source on that page, you would probably see that it is indeed putting the newlines in there.

    What you need to do is convert the newlines to something that is valid HTML, such as <br />. PHP even provides a handy function to achieve what you are looking for.

      Write a Reply...