PDA

View Full Version : display text



abhishek1
January 2nd, 2006, 07:00 AM
hi,
can any 1 tell me how to display text in same format as it is stored in database.
i m putting some details of user in my database using text area.

for ex:-
Name=abc
sirname=xyz

but when i retreive the data from database and display it,it comes like this:-
Name=abcsirname=xyz.

i want it in same format (as it was entered in database) like:-
Name=abc
sirname=xyz.

can any1 spread some light on it.
i m using PHP4 with mysql and apache as webserver and Smarty templates.

it'll b good if ne1 can tell me hw to find a line break in a text frm text area.

This kind of thing
if(linebreak)
abc
else
xyz


thanx and regards:flower:

cholin
January 2nd, 2006, 06:19 PM
When you export the data, replace "\n" or "\r\n" with a simple <br>. \n and \r\n are linebreaks, one is for windows, one is for linux. When your data is inserted, it retains thoe linebreaks.