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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Space between paragraph when pulling text from DB

Status
Not open for further replies.

DrumAt5280

Technical User
Sep 8, 2003
194
0
0
US
When pulling text information from my DB that I know is formatted correct with spaces between paragraphs I get all one string of text without spaces when i view it on the outputted page.

Is there a html tag in need to wrap around the text to have it formatted like i see in my MySQL DB with spaces betwen paragraphs?

Thanks
 
Chris,

Thanks, I just tried that tag and it worked, however now i lost my word wrap (each paragraph runs off the screen in one long single line).

Is the a function of how i got it in to the DB or is it the HTML tag?

Thanks.
 
When you are "pulling" the data from the database, are you using ASP? If so, you can use the replace() function to replace the line feed with an HTML element. It should look something like this: (Where Blah is the field from the database.)

Code:
replace(Blah, char(10), "<br>")

-Brian-
I'm not an actor, but I play one on TV.
 
Jedi,

I tried the following but it didn't work. Still no spaces between paragraphs - i know it the REReplace tag works because i replaced "char(10)" below with a word i know is in the query and it worked fine creating the space.

Code:
<cfset dbvDescrip=REReplace(GetAd.rentaladdescription,'char(10)','<br><br>','All' )>
<p><cfoutput>#dbvDescrip#</cfoutput></p>

I am a Coldfuion guy.

I like your line of thinking, i just don't know much about char(10). I am not finding much about it yet on Google.

I am using <cfcontent type="text/html; charset=ISO-8859-1"> if that helps at all.
 
I figured it out:

Code:
<cfset dbvDescrip=REReplace(GetAd.rentaladdescription,'#chr(13)##chr(10)#','<br>','All' )>
<p><cfoutput>#dbvDescrip#</cfoutput></p>

The #chr(13)##chr(10)# makes it work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top