PDA

View Full Version : SQL query for specific text in homepage field


kgroneman
05-23-2014, 02:21 PM
Can someone help me create a query that lists all users with a specific string of characters in the homepage field? I have a spammer that has the word barbara in a URL of the home page.

I've tried

SELECT * FROM `vb_user`WHERE homepage='%barb%'

It doesn't give me an error, but it gives me 0 results. If I change to 'http%' which I know there are lots of, it still gives me 0 results. Obviously I'm doing it wrong. If I do an empty query with two single quotes, it works to give me all users without a homepage.

:confused:

Thanks in advance.

nhawk
05-23-2014, 02:38 PM
Try this..

SELECT * FROM `vb_user`WHERE homepage LIKE '%barb%'

kgroneman
05-23-2014, 03:43 PM
Duh. I should have seen that. Thanks for the slap across the face. It works. :-)