Solved

Cr / lf in MySQL text

Posted on 2014-12-19
4
141 Views
Last Modified: 2014-12-19
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.
0
Comment
Question by:Richard Korts
  • 2
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40509593
UPDATE tablename set fieldname= REPLACE(REPLACE(fieldname,'\r',''),'\n','')

Open in new window

0
 

Author Comment

by:Richard Korts
ID: 40509659
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
0
 

Author Closing Comment

by:Richard Korts
ID: 40509678
Works in MySQL. I had preferred not to change the database text, but ..............
0
 
LVL 58

Expert Comment

by:Gary
ID: 40510307
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>
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now