Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Cr / lf in MySQL text

I have this text in a MySQL database "blob" field:

"Initially a warranty call but water was shut off and we spent a few days troubleshooting and fixing leaks on old system that had been disconitued.

When we got everything working we made adjustments on new rotors and rebuilt 1 1/2" valve that was stuck open (warranty)"

I want to eliminate the cr / lf characters when I extract it into a php program.

How can I do that?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Korts

ASKER

Gary,

I did the equilavent of that if php, using str_replace, like this:

$wc = str_replace('\r', ' ', $wc);
$wc = str_replace('\n', ' ', $wc);

$wc being the extracted value from the database.

Has no effect.

The text was probably entered on an iPad. Does that make a difference?

Thanks
Works in MySQL. I had preferred not to change the database text, but ..............
Ahh you didn't say you wanted to do it in PHP, your zones were just MySQL
It would depend on how the CR's were being interpreted and stored in the DB i.e are they using the HTML tag of <br>