lat and longitude to store in table

Home Forums Quform PHP lat and longitude to store in table

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13401
    Frens
    Participant

    Hi,

    I try the lat and longitude to store in the table

    $user_ip = getenv(‘REMOTE_ADDR’);
    $geo = unserialize(file_get_contents(“http://www.geoplugin.net/php.gp?ip=$user_ip”));
    $latitude = $geo[“geoplugin_latitude”];
    $longitude = $geo[“geoplugin_longitude”];
    $coords = $geo[‘geoplugin_latitude’] .’, ‘. $geo[‘geoplugin_longitude’];

    $query .= “point = ‘” . $coords . “‘,”;

    But got this error , someone an idea?
    Cannot get geometry object from data you send to the GEOMETRY field

    #13412
    Frens
    Participant

    It must like:

    $query.=” point = POINT({$latitude},{$longitude}) “;

    or

    $query.=” point = ‘” .POINT({$latitude},{$longitude}). “‘,”;

    But got error:

    You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax

    I dont now how to make a better syntax for the $query ??

    • This reply was modified 9 years, 11 months ago by Frens.
    #13416
    Frens
    Participant

    Find out. must a comma after $longitude})

    $query.=” point = POINT({$latitude},{$longitude}), “;

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy