473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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
3 3583
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
.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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my...
6
by: Lasse | last post by:
I have done this simple function, it seems to work as intended, to solve a problem i have had for a while. I couldnt find any sample around that was working for me. I would like to test it with...
37
by: Haines Brown | last post by:
I understand that <br /> is marginal in CSS, and so am looking for a substitute for the EOL character. I've failed in both approaches and seek advice. The first thing I tried was to use the...
13
by: meltedown | last post by:
Earlier, there was a discussion of why not to use <br>s too much. I mostly don't like using <br>s at all but there is one situation where its seems better than the alternative. <h4> this is the...
7
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
2
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all...
1
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all...
2
by: xhe | last post by:
I met a very headache problem in javascript, I think this might be difference between IE and NS / Safari. I have a text area <form> <textarea name='tex1' onkeyup='displayit();'></textarea>...
7
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.