SELECT
c.country
FROM
ip2nationCountries c,
ip2nation i
WHERE
i.ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'")
AND
c.code = i.country
ORDER BY
i.ip DESC
LIMIT 0,1
SELECT
c.country
FROM
ip2nationCountries c,
ip2nation i
WHERE
i.ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'")
AND
c.code = i.country
ORDER BY
i.ip DESC
LIMIT 0,1
发布评论
评论(2)
我相信,它使用 INET_ATON() 和 INET_NTOA() mysql 函数
更新:
是的。我刚刚检查过。
I believe, it uses INET_ATON() and INET_NTOA() mysql function
update:
Yep. I've just checked.
只需查看示例脚本:
Just look at the Sample Scripts: