For Programmers: Free Programming Magazines  


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
Bastien Koert

2006-03-20, 6:56 pm

see the nl2br function in the manual (www.php.net/nl2br)

bastien


>From: "Giff Hammar" <ghammar@certifiedparts.com>
>To: <php-db@lists.php.net>
>Subject: [PHP-DB] Remove newlines from field
>Date: Mon, 20 Mar 2006 17:00:49 -0500
>
>I am using a PHP script to pull information from a FoxPro database via
>ODBC.
>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
>existing
>info and try to update the database. It fails with an "unrecognized
>command"
>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/>
>mailto: ghammar@certifiedparts.com
>V: 603.516.1707
>F: 603.516.1702
>M: 603.490.7163
>

Sponsored Links







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

Copyright 2008 codecomments.com