tI'm almost there in getting MySQL to do a geoip lookup in the locally stored maxmind database. Instructions I've been following work when using the command line mysql > syntax for retrieving records. such as:
mysql> SELECT glc.*
FROM geoip_blocks gbl
JOIN geoip_locations glc
ON glc.glc_id = gbl.gbl_glc_id
WHERE gbl_block_start <= INET_ATON('149.156.1.4')
ORDER BY gbl_block_start DESC
LIMIT 1\G
However, I am having difficulty translating this to a mysql query in a php script.
I've tried:
`Select glc.* from geoip_blocks gbl JOIN geoip_locations glc ON glc.glc_id = gbl.gbl_glc_id WHERE gbl_block_start <= INET_ATON('149.156.1.4') ORDER BY gbl_block_start DESC LIMIT 1\G`
But this doesn't work. I'm sure this is an easy fix but I'm stumped.