PDA

View Full Version : Need help with PhpMyAdmin search feature


DF031
05-26-2013, 07:20 PM
Hi All,

I would like to use phpmyadmin to locate some records in the table "post" and column "pagetext".

https://dl.dropboxusercontent.com/u/2287968/Forums/VB6582/phpmyadmin-search.JPG

I want to search for:

-- search starts below--


%%
-- search ends above --

So basically it is two blank lines followed by %%

Now how do I do that, I know how to use the search options, but what do I enter for the blank lines ?

Thanks in advance for your help

kh99
05-27-2013, 12:05 AM
Try %\\n\\n\%\%%

DF031
05-27-2013, 05:50 AM
Hi KH, thanks for the help.

I got no hits at all.

In order to test I also tried:
Like %...% -->\\n
Like -->\\n

Both no hits (10 000 posts forum). So it looks like the query is incorrect.

kh99
05-27-2013, 09:49 AM
Yeah, it doesn't seem to work. \n should match a line break, I think. Playing around with it, it looks like phpMyAdmin adds the extra backslash for you, so it seems like \n\n\%\% should work (the % still need a backslash because it's the wildcard character). But when I tested it, nothing I tried would match the line break. Sorry, hopefully someone else knows.

DF031
05-27-2013, 11:20 AM
Thanks KH

Seems \n is not the right approach.

I started to do a simple seach:

https://dl.dropboxusercontent.com/u/2287968/Forums/VB6582/nnnnnnnnnnnnnnnnnn.PNG

That search finds texts with words like: Ennnnnn

Looks like the query ignores the \ and just tries to find multiple concurrences of n.

Also tried the query \n and compared it to n

Has the exact number of hits (89008)

kh99
05-27-2013, 11:52 AM
Hmm...yeah, I guess phpMyAdmin is escaping whatever is in that field, including backslashes, so there's no way to put in special characters (or if there is a way, I can't figure it out).

But maybe try this instead: use the SQL tab and sql like
SELECT * FROM post WHERE pagetext LIKE '%\n\n\%\%%'


or
SELECT * FROM post WHERE pagetext LIKE '%\r\n\r\n\%\%%'