Hi,
I really appreciate your assistance. I am using MySQL with PHP.
SELECT cn As 'Country Visited', count(0) AS 'No. of Times'
FROM mslop_login_activity a
INNER JOIN ip ON ( INET_ATON(a.hostname) BETWEEN START AND END )
NATURAL JOIN CC
GROUP BY cn
I did come up with this query but it's giving me a constant number of Visits.
For e.g., I tried running the script with this IP 157.191.122.36, instead of INET_ATON(a.hostname) (as this IP address is the most common in the login_activity table) and the Query gave me
United States | 208
. I then added sample Netherlands IP of (5.10.88.12) as a test in the login_activity table and the correct response should have been
Netherlands | 3,
but it gave me
Netherlands | 280
. So the number 280 is coming in regardless of the IP I put in.
I'll be very thankful if you could help in any way or may be devise a correct change in this query.
Many Thanks.