In reply to [EMAIL PROTECTED]:

> Return-Path: <[EMAIL PROTECTED]>
> Received: from toye.php.net (va.php.net [198.186.203.51])
>         by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4DGDXZ25935
>         for <[EMAIL PROTECTED]>; Mon, 14 May 2001 00:13:39 +0800
> Received: (qmail 12864 invoked by uid 1013); 13 May 2001 16:15:49 -0000
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> list-help: <mailto:[EMAIL PROTECTED]>
> list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> list-post: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> Received: (qmail 12848 invoked by uid 9); 13 May 2001 16:15:49 -0000
> To: [EMAIL PROTECTED]
> From: "Ciaron Nixon" <[EMAIL PROTECTED]>
> Date: Sun, 13 May 2001 17:22:28 +0100
> Lines: 9
> Message-ID: <9dmbvl$chc$[EMAIL PROTECTED]>
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
> Subject: [PHP] multiline text areas and mysql doesn't work :(
> X-UIDL: ;GH!!Oa4!!_P6"!Z&K!!

> I'm trying to insert the conents of a submitted textarea into a field of a
> db but it seems to be stripping the control characters or not fomatting them
> properly. The record updates fine but when I display it all the newlines are
> gone ie the whole field appears on 1 line.
> Any ideas how to get it to store the control chars?

> -Ciaron




Use nl2br() to format the display properly in HTML.
Goto www.php.net/nl2br for more info.

So this would work well:

<?php echo nl2br($query); ?>

Updating the record works because you probably did something like this:

<textarea><?php echo $query; ?></textarea>


Regards,
Keith Ng
_______________________________
Co-founder
K-Designs Incorporated
[EMAIL PROTECTED]

http://www.k-designs.com.sg/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to