Search for literal line break string in mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Search for literal line break string in mysql

Post by s.dot »

I've a bunch of malformed table fields with the actual string "\r\n" in them. How can I search for the literal string (results show that I am searching for an actual line break and not the literal representation of them)?

I've tried:
[text]WHERE `field` LIKE '%\r%'[/text]

and \\r and \\\r and etc. Only tried matching the \r first because once i get that right i can add the \n in it.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Search for literal line break string in mysql

Post by s.dot »

Hmm, could be a bug in the phpmyadmin version I'm using.

From what I understand, I should be searching for WHERE field LIKE '%\\r%'
It returns results, but the results have linebreaks, not the linebreak character sequence like I am looking for.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply