Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading the br as a line break when retrieving from mysql 3

Status
Not open for further replies.

sophielois

Technical User
Sep 8, 2005
66
GB
hello.....again,

Im displaying data from a mysqltable. In the table the data looks like this
Code:
hello<BR> what<BR>  is this working or not<BR> I<BR>  hope so<BR>

How do i display the data so that it reads the <br> as line breaks?

at the moment it is displaying the data like this
Code:
hello what is this working or not I hope so
eg no line breaks

Help
Soph
 
The data is getting put into the databse from a text area.

The <br> is not being typed, it is appearing when pressing
return.

What do i need to be looking at doing so that if a user hits return it would create a html <br>?

Soph



 
when a user submits the form, the returns in the textarea will automatically be turned into \ns, which, in turn, is passed onto the SQL database - so when the next php script loads the entry, it replaces the \n with a <br>.

-> LuckySyringe
 
when you load the data into the db, it should look something like this:

$sql="insert into database set answer='nl2br($answertext)' where ....";

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Thanks for all the help

as its christmas here's your stars!!

Sophxx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top