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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:02:32+00:00 2026-05-29T04:02:32+00:00

$url = ‘http://maps.google.com/maps/geo?q=’.str_replace( ,,$postcode[$z]).’,+UK&output=csv&sensor=false’; $data = @file_get_contents($url); echo $data; $result = explode(,, $data); $lat

  • 0
            $url = 'http://maps.google.com/maps/geo?q='.str_replace(" ","",$postcode[$z]).',+UK&output=csv&sensor=false';

            $data = @file_get_contents($url);

            echo $data;

            $result = explode(",", $data);

            $lat = (float) $result[2]; // latitude
            $lon = (float) $result[3]; // longitude;

            echo '<br>Latitude: '.$lat;
            echo '<br>Longitude: '.$lon;                
            $wpresult = $wpdb->insert("buss_add",array(
                "buss_id" => $buss_id,
                "add1" => $add1[$z],
                "add2" => $add2[$z],
                "city" => $city[$z],
                "county" => $county[$z],
                "postcode" => $postcode[$z],
                "country" => $country[$z],
                "tel" => $tel[$z],
                "lat" => $lat,
                "lon" => $lon
            ),array(
                "%d","%s","%s","%s","%s","%s","%s","%s","%f","%f"
            ));

Despite this being right, and even with typecasting the lat and lon variables this does not seem to want to go into the database as a float. I think wordpress $wpdb is to blame. Anyone got any ideas?

To also confirm the database looks like this, which should be absolutely fine – http://cl.ly/421m2K3F2k3p3X1D3V1v

An example of the values below:

Latitude: 51.7191557
Longitude: 0.6665619

  • 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-29T04:02:33+00:00Added an answer on May 29, 2026 at 4:02 am

    assuming $lat is a string and $z is some number, then $lat[$z] is one char in that string, shouldn’t you just use "lat" => $lat ?

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

Sidebar

Related Questions

URL: http://maps.google.com/maps/api/staticmap?center=40.714728,-73.998672&markers=icon:http://tinyurl.com/2ftvtt6&zoom=12&size=400x400&sensor=false I have no clue what I'm doing wrong here. Developer Guide: API
The url http://code.google.com/intl/lv/apis/maps/documentation/directions/ includes the following :- > Usage Limits Use of the Google
What url do you use for it because http://www.red5.org/projects/red5plugin/update_0.1.x/ gots redirected to http://code.google.com/p/red5/ ,
URL Download http://code.google.com/p/mwiphonesdk/source/browse/#svn/trunk/iMADE/PrepTasks/08 I have code at the location at the link above and
This url ' http://profile.myspace.com/index.cfm?fuseaction=user.viewProfile&friendID=39726387 ' works perfectly well in a browser but cURL return's
URL: http://ws.audioscrobbler.com/2.0/?method=chart.gethypedtracks&api_key=1732077d6772048ccc671c754061cb18&limit=10 From the above url I need to somehow remove the Artist name
URL url = new URL(http://www.example.com/comment); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod(POST); Is connection.setRequestProperty(key,
URL url = new URL(http://twitter.com/statuses/update.xml); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); String cridentials =
url: http://www.pagepilot.co.uk/pp_cftest/ When posted into facebook debugger: https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.pagepilot.co.uk%2Fpp_cftest%2F Keeps returning a 206 Partial Response
Given: Url - http://www.contoso.com/search.php?q= {param} returns: -html- --body- {...} ---div id='foo'- ----div id='page1'/- ----div

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.