Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

PHP, mySQL and Text in Fields
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.



Report this thread to moderator Post Follow-up to this message
Old Post
Neil H
04-26-05 08:57 PM


Re: PHP, mySQL and Text in Fields
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Jason F.
04-27-05 01:55 AM


Re: PHP, mySQL and Text in Fields
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

Report this thread to moderator Post Follow-up to this message
Old Post
Oli Filth
04-27-05 01:55 AM


Re: PHP, mySQL and Text in Fields
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 
one 
>
> Either output the text as-is between PRE tags, or use the nl2br()
> function to convert the newlines to BR tags.



Report this thread to moderator Post Follow-up to this message
Old Post
Neil H
04-27-05 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:32 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.