Forum Moderators: coopster

Message Too Old, No Replies

[MYSQL] Selecting part of IP address

Searching for Googlebot visits.............

         

rubenski

6:18 pm on Dec 9, 2003 (gmt 0)

10+ Year Member



Hi,

I am trying to create a query that will search the ip field of a table for the starting characters of the Googlebot ip:
'209.185'.

How can I do this? I have found some info on LIKE over here.

[mysql.com...]

But i can't really translate that into a useful query. Some more searching on LIKE yielded like thousands of pages of people that use the word like like a million times on every like 4 pages. Some useful search terms are also appreciated.

Timotheos

6:57 pm on Dec 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I wish I knew mySQL better but wouldn't this work best...

SELECT * FROM tablename WHERE LEFT(ip,7)='209.185';

rubenski

10:41 pm on Dec 9, 2003 (gmt 0)

10+ Year Member



Hey. Thanks. That indeed works, but the query returns an empty result which means my site has not been visited by Google for 6 weeks.

Errrr...this makes no sense. Two pages of the new part of my site (created 3 and 6 November) have been indexed by Google, while my stats show no Google visits since the start date of my stats script, 28 October.

Well, anyway i got an answer to my mysql question. Thanks. :-)

GeorgeGG

10:56 pm on Dec 9, 2003 (gmt 0)

10+ Year Member



Try: 216.239. and 64.68.

GGG