Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:51:07+00:00 2026-05-27T06:51:07+00:00

I am using the binary version of MaxMind’s GEOIPCITY database. The following code gives

  • 0

I am using the binary version of MaxMind’s GEOIPCITY database. The following code gives me all the information I need about my visitors:

include("geoipcity.inc");
include("geoipregionvars.php");

$gi = geoip_open("GeoLiteCity.dat", GEOIP_STANDARD);
print_r( geoip_db_get_all_info() );
$record = geoip_record_by_addr($gi, $user_ip);
print $record->country_code . " " . $record->country_code3 . " " . $record->country_name . "<br /><br />";
print $record->region . " " . $GEOIP_REGION_NAME[$record->country_code][$record->region] . "<br /><br />";
print $record->city . "<br /><br />";
print $record->postal_code . "<br /><br />";
print $record->latitude . "<br /><br />";
print $record->longitude . "<br /><br />";
print $record->metro_code . "<br /><br />";
print $record->area_code . "<br /><br />";
print $record->continent_code . "<br /><br />";
geoip_close($gi);

I don’t really need anything beyond this like network speed, ISP, etc.

My issue is, there are parts of my site where I need to display all the cities under a particular state, or all the states/regions in a particular country. For example I need to do this in the registration form.

Is there no way to get these lists by querying the binary file? or do I have to handle all that from the mysql version?

I would prefer to use only the binary version since it’s faster, but now I am not sure if the displaying of all zips under a certain city or all states under a certain country, etc. is possible without using the mysql version. Does one need to use both?

http://www.maxmind.com/app/php
http://geolite.maxmind.com/download/geoip/api/php/
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:51:08+00:00Added an answer on May 27, 2026 at 6:51 am

    The GeoIP database is intended for one purpose, and one purpose only: to return location information for an input IP. It is not a general-purpose GIS database, and will not work for that purpose, as there are some locations which won’t be returned for any IP. (For instance, a small town with no local Internet service might not appear in their database at all, since any IP in that town would likely be categorized under another nearby city.)

    Maxmind has a separate “World Cities with Population” database that is more likely to be suitable for this purpose: http://www.maxmind.com/app/worldcities

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a database application using a binary file as storage. it is
Possible Duplicate: Locking binary files using git version control system I am committing a
I have build cocoa application in 10.4.4 using (mac10.3.9sdk xcode version:2.2.1,universal binary), but when
How do I achieve the following in CMake (using version 2.8.5)? I have documentation
I'm looking for some tips to implement binary --version that would provide good information
If I wanted to represent states or options or something similar using binary flags
I am writing the below structure in to the file using Binary Writer. File
Apple strongly recommends using the binary plist format when reading large XML-based data sets
I have a data object that is deep-cloned using a binary serialization. This data
I'm using a huge binary tree like structure whose nodes may or may not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.