I want to get Country = Total by IPs Adressen in php query already build the basis:
$result = mysql_query("SELECT t.*, gi.cname FROM tasks t LEFT JOIN geoip_all gi WHERE t.ip > geoip_all.iplong_start && t.ip < geoip_all.iplong_end", $link);
$county = mysql_num_rows($result);
echo "<p>County:\n $county</p> ";
I made this query so far only it don't work.
SELECT t.*, gi.cname FROM tasks t LEFT JOIN geoip_all gi WHERE t.ip > geoip_all.iplong_start && t.ip < geoip_all.iplong_end
Error message from query run in phpmyadmin:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'JOIN geoip_all.cname LIMIT 0, 30' at line 1
geoip_all.cname
= Country name
geoip_all.iplong_start
= start of the ip ranges
geoip_all.iplong_end
= start of the ip ranges
task.ip
= IP from the visitor in the colunm is this the value : 636736027
Screenshots of the database:
geoip_all table: http://screencloud.net/v/5CgY
task.ip: http://screencloud.net/v/6B0L