6 messages in com.mysql.lists.mysqlRe: Preserving format of text fields
FromSent OnAttachments
Ord Millar01 Nov 2000 10:04 
Julia A . Case01 Nov 2000 10:11 
Douglas Brantz01 Nov 2000 11:08 
James Treworgy01 Nov 2000 16:43 
Claus Nybo01 Nov 2000 18:21 
Student7 SNT02 Nov 2000 04:03 
Subject:Re: Preserving format of text fields
From:Student7 SNT (stu@nortelnetworks.com)
Date:11/02/2000 04:03:54 AM
List:com.mysql.lists.mysql

Hi,

This is a fairly simple one, MySQL should have preserved the format for you.

What you will need to do is indicate to the HTML page that the text is preformatted. This is done with the <PRE> and </PRE> tags.

so we have something like this:

<PRE>

<?php echo($article); ?>

</PRE>

Which will print the content of '$article' complete with line breaks.

-Chris Davies

At 06:21 PM11/1/00 -0800, you wrote:

Hi,

I am working on a website using php3 and mySQL. On one page in the site administration is inputting new articles, via a form, with fields such as $title, $date, $article, etc. These are then passed to mySQL, to be viewed on another page by users.

This all works fine, except for the text of the article itself. When the text is typed in to the textfield on the form, it exist of several paragraphs, with blank lines in between, but when it is viewed from the database on another page all the paragraph breaks and blank lines are gone, and all the text is displayed in just one long continued block.

What do I do to preserve the format in which the text is typed? With the different paragraf breaks and blank lines?

Thanks for the help!

Claus