Update IP2country

Modified on Wed, 25 Feb at 5:52 AM

-- clear existing ipcountry table (dump file doesn't drop table beforehand. it does try to create it again)
DROP TABLE `ipcountry`

-- phpMyAdmin import: IPCountry.mysql.dump

-- clear existing ip table entries
TRUNCATE `ip`

-- add entries with appropriate country id
INSERT INTO `ip` (`start`, `end`, `ci`)
SELECT ipFROM, ipTO, country.id
FROM ipcountry
INNER JOIN country ON country.abbreviation = ipcountry.countrySHORT

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article