Home > Archive > PHP DB > March 2006 > Re: [PHP-DB] Remove newlines from field
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 |
Re: [PHP-DB] Remove newlines from field
|
|
| Ludvig Ericson 2006-03-20, 6:56 pm |
| Mind you Pearl programmers, what would that do?
On 3/20/06, Giff Hammar <ghammar@certifiedparts.com> wrote:
> Thanks, Jeremy and Bastien. I just tried nl2br and it has the unfortunate
> side effect of losing everything except the most recently added data when=
I
> update the database. I think I need something like the 'local $/ =3D "\r\=
n"'
> construct in perl...
>
> Giff
>
> _____
>
> From: Jeremy Peterson [mailto:jeremy.peterson@moody.edu]
> Sent: Monday, March 20, 2006 5:14 PM
> To: Giff Hammar
> Subject: Re: [PHP-DB] Remove newlines from field
>
>
> Try nl2br.
>
> http://php.net/nl2br
>
> At 04:00 PM 3/20/2006, you wrote:
>
>
> I am using a PHP script to pull information from a FoxPro database via OD=
BC.
> One of the fields is a memo field (large text) that contains newline
> characters. Displaying this info to the web page is fine as the newlines =
are
> ignored. The challenge is when I combine user entered text with the exist=
ing
> info and try to update the database. It fails with an "unrecognized comma=
nd"
> because the end of field delimiter is on a different line. We're running =
on
> PHP 4.2.7 and I have tried using various combinations of str_replace to
> eliminate the newline characters, but I have been unsuccessful. Any
> suggestions?
>
> Giff
>
> Giff Hammar
> IT Director
> Certified Parts Warehouse
> http://www.certifiedparts.com <http://www.certifiedparts.com/> <
> <http://www.certifiedparts.com/> http://www.certifiedparts.com/>
> mailto: ghammar@certifiedparts.com
> V: 603.516.1707
> F: 603.516.1702
> M: 603.490.7163
>
>
>
>
> Jeremy Peterson, MACS
> Automation Systems Administrator
> Crowell Library
> Moody Bible Institute
> 820 N. LaSalle Drive
> Chicago, IL, 60610
>
> Email: jpeterso@moody.edu
> Phone: 312.329.8081
> Fax: 312.329.8959
>
>
>
| |
| Giff Hammar 2006-03-21, 7:55 am |
|
-----Original Message-----
From: Ludvig Ericson [mailto:ludvig.ericson@gmail.com]
Sent: Monday, March 20, 2006 5:54 PM
To: Giff Hammar
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Remove newlines from field
Mind you Pearl programmers, what would that do?
[snip]
It changes the end of line delimiter to match the platform that you're on
(\r\n for Windows, \r for Mac and \n for Unix/Linux).
|
|
|
|
|