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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:18:36+00:00 2026-05-21T14:18:36+00:00

Hey, I know the title is really bad…I didn’t know what else to say.

  • 0

Hey, I know the title is really bad…I didn’t know what else to say. Well anyways, I have a website that I want to track their ip and geo address ip, and found this snippet from CSS-Tricks, http://css-tricks.com/snippets/php/get-geo-ip-information/
I got that working, and the return was Array ( [domain] => dslb-094-219-040-096.pools.arcor-ip.net [country] => DE - Germany [state] => Hessen [town] => Fl�rsheim ).


I have made a table and want to disect that array and put city into one mysql row, country into another one, and domain into another one. Can anyone help me make a mysql insert that inserts all of these different datas into each corresponding mysql row?

Thanks for all help…I have just recently started learning php, so I am still quite of a beginner.

  • 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-21T14:18:37+00:00Added an answer on May 21, 2026 at 2:18 pm

    Since the geoCheckIP already returns an array (read more), you can do as follow:

    $geoData = geoCheckIP($ip);
    

    And you would read each value like:

    $geoData["domain"]
    $geoData["country"]
    $geoData["state"]
    $geoData["town"]
    

    And a MySQL insert for this would be something like:

    $query = sprintf("INSERT INTO `users_data` (`domain`, `country`, `state`, `town`) VALUES ('%s', '%s', '%s', '%s')", mysql_real_escape_string($geoData["domain"]), mysql_real_escape_string($geoData["country"]), mysql_real_escape_string($geoData["state"]), mysql_real_escape_string($geoData["town"])); 
    

    More on mysql_real_escape_string

    More on php and mysql

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

Sidebar

Related Questions

Hey all, title may be abit misleading but i didnt know the correct way
Hey i dont know if that is possible but i want to set a
Hey, I don't have any code because I don't know how to do this.
Hey guys, I have a bit of a problem that I can't solve. I'm
Hey friend as you know I am new in iphone I didn't know any
hey. friends i dont know this question is really asked before or not ?
Hey! i want to know the best solution for my problem. I have a
Hey there, I need some help with some MYSQL Joins that I really don't
Hey! I know title of question is very scary but I still I am
hey, had no idea what title this post should have, hard to describe :)

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.