For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > April 2005 > PHP, mySQL and Text in Fields









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP, mySQL and Text in Fields
Neil H

2005-04-26, 3:57 pm

Hi,

I want to be able to display the contents of a field, stored in a mySQL
table, to be displayed as it was entered (ie. with the carriage returns in
place).

At the moment when i display the contents of the field it puts it into one
continuous sentance.

Regards,
Neil.


Jason F.

2005-04-26, 8:55 pm

Neil H wrote:
> Hi,
>
> I want to be able to display the contents of a field, stored in a mySQL
> table, to be displayed as it was entered (ie. with the carriage returns in
> place).
>
> At the moment when i display the contents of the field it puts it into one
> continuous sentance.
>
> Regards,
> Neil.
>
>


Either output the text as-is between PRE tags, or use the nl2br()
function to convert the newlines to BR tags.
Oli Filth

2005-04-26, 8:55 pm

Neil H wrote:
> Hi,
>
> I want to be able to display the contents of a field, stored in a mySQL
> table, to be displayed as it was entered (ie. with the carriage returns in
> place).
>
> At the moment when i display the contents of the field it puts it into one
> continuous sentance.


Only when displayed in a browser as HTML. Either display as text, or
replace line-breaks with <BR>.



--
Oli
Neil H

2005-04-27, 3:56 am

That did the job,

Thanks.
Neil.

"Jason F." <jason.newsonly@gmail.com> wrote in message
news:DFvbe.16645$mp6.2184782@twister.nyc.rr.com...
> Neil H wrote:
in[color=darkred]
one[color=darkred]
>
> Either output the text as-is between PRE tags, or use the nl2br()
> function to convert the newlines to BR tags.



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com