Paragraphs in php from mysql

hello
i have a mysql database and the text fields will be to appear on a php page.
everything is working fine except the paragraphs… what i have to do so i can add paragraphs in a mysql entry and it appear on the php?
Thx in advance

you have to use the nl2br() function. (new line 2 break).

It converts the new line character in text fields into <br> tags for html. When you draw the information from the database and output it to the page format the text by using the function:


$text = nl2br($text);

sweet, i needed to know that one too;)

Now where in the HELL was that in my PHP and MySQL for dynamic websites book… oh well, live and learn.

thanks ironikart :slight_smile:

Now where in the HELL was that in my PHP and MySQL for dynamic websites book… oh well, live and learn.

lol im using the same book right now as reference and i didnt see it either, dunno if i missed it or ullman didnt put it in there. I really like that book though;)