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 6865691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:05:08+00:00 2026-05-27T03:05:08+00:00

To get the user’s IP I’m using: $ip = $_SERVER[‘REMOTE_ADDR’]; I have a geo

  • 0

To get the user’s IP I’m using:

$ip = $_SERVER['REMOTE_ADDR'];

I have a geo database with the following tables:

blocks
locations
zipcodes
nations
dma_codes
states

This is the table I’m interested in

blocks

start_ip | end_ip | location_id
-------------------------------

33996344 | 33996351 | 16373
50331648 | 67166463 | 223

etc...

Above are just the first 2 records of the 1,866,401 rows in total in that table. I have no idea which geo database this is. Maybye MaxMind but not sure. I inherited this project from the client’s previous developer who uploaded this database but didn’t do anything with it yet. So I have no code samples to go on.

Can anyone please explain how I would get the location_id if my ip address happens to be:

72.63.83.41

Also does anyone recognize these table names so maybye I can find out which geo db this is.

  • 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-27T03:05:09+00:00Added an answer on May 27, 2026 at 3:05 am

    IPv4 addresses are just 32bit integers, and you can use MySQL to convert a ‘string’ IP address to/from those ints via inet_ntoa() (number to ascii) and inet_aton() (ascii to number).

    SELECT location_id
    FROM yourtable
    WHERE INET_ATON('70.63.83.41') BETWEEN start_ip AND end_ip
    

    would give you any matching location_id for that particular IP.

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

Sidebar

Related Questions

I have the following code to get user data form facebook <div id=fb-root></div> <script>
Possible Duplicate: Function to get user ip address <?PHP $ipaddress = $_SERVER[REMOTE_ADDR]; echo Your
I have heard that using blinking text in a page to get user's attention
I get user list from database in jsp. In each user I have a
If I have a program that is using scanf to get user inputted data:
I have following two entities public class User { public int UserId { get;
How to get user roles from Membership provider? Suppose I have a username and
I have an application that needs to hit the ActiveDirectory to get user permission/roles
I want to get user names in active directory by using sharepoint webpart. any
I am trying to get user album by using GRAPH API with function facebook.request(contact.getFacebook_id()+/albums)

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.