• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

displaying carriage returns from database query

New Here ,
May 03, 2006 May 03, 2006

Copy link to clipboard

Copied

hi i'm fairly new to colfusion but have a good basic understanding.

i'm trying to build a community website that has a guestbook and forums. i want to build these from scratch.

i'm using cfmx7 and sqlserver 2005.

the problem i'm having is when my cfm page retrieves posts made to the guestbook or forum, the carriage return characters are missing. posts are coming out all on one line.

how do i get the retrieved posts to display new lines and paragraphs the way they were input into the database?

just like these forums do?

thanx so much. adella.
TOPICS
Advanced techniques

Views

865

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 03, 2006 May 03, 2006

Copy link to clipboard

Copied

How are you displaying the output? Include some code.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 03, 2006 May 03, 2006

Copy link to clipboard

Copied

Here is the code. Just replace body with your db field name.

<cfoutput>
#Replace(body, newLine, "<br>", "ALL")#
</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 03, 2006 May 03, 2006

Copy link to clipboard

Copied

LATEST
...or:

<cfoutput><pre>#textFromDatabase#</pre></cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation