By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,303 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,303 IT Pros & Developers. It's quick & easy.

how do I display <br> where database record has new paragraph?

P: n/a
I have a form that inserts records in a database. When I display records,
the paragraphs don't show up.

I am using dreamweaver MX, PHP, and MySQL.
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
NotGiven wrote:
I have a form that inserts records in a database. When I display records,
the paragraphs don't show up.

I am using dreamweaver MX, PHP, and MySQL.


Use nl2br() - http://www.php.net/nl2br

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #2

P: n/a
.oO(NotGiven)
I have a form that inserts records in a database. When I display records,
the paragraphs don't show up.

I am using dreamweaver MX, PHP, and MySQL.


You could use nl2br() to replace the linebreaks with HTML-linebreaks,
but the better solution would be to keep the paragraphs, i.e. to replace
double linebreaks with </p><p> (easy to do with preg_replace() or
str_replace()) and enclose the entire string with <p></p>.

For a stored string

paragraph 1\n\nparagraph 2

the result would be

<p>paragraph 1</p><p>paragraph 2</p>

Micha
Jul 17 '05 #3

P: n/a

"NotGiven" <no****@nonegiven.net> wrote in message
news:EV*******************@bignews1.bellsouth.net. ..
I have a form that inserts records in a database. When I display records,
the paragraphs don't show up.

I am using dreamweaver MX, PHP, and MySQL.

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.