<?php
require_once('../db.php');
$sqlQuery = mysql_query("SELECT `County` FROM `ManualInsert_Infectious_Disease_Cases_by_County`");
/* Fetch county */
while($rows = mysql_fetch_array($sqlQuery))
{
$countyArr = $rows['County'];
}
/* Call google API and save coordinates for each county */
'https://maps.googleapis.com/maps/api/geocode/JSON?'.$countyArr[i].',+CA'
/* Create columns('lat'),('long') IF not exist and update columns ('lat'),('long')*/
?>
<?php require_once('../db.php'); $api_key = "din nyckel.." $sqlQuery = mysql_query("SELECT `County` FROM `ManualInsert_Infectious_Disease_Cases_by_County`"); /* Fetch county */ while($rows = mysql_fetch_array($sqlQuery)) { $countyArr = $rows['County']; /* Call google API and save coordinates for each county */ $json = get_file_contents("https://maps.googleapis.com/maps/api/geocode/json?address=$countyArr&key=$api_key"); $obj = json_decode($json); if ($obj->status == "OK") { $lat = $obj->results->location->lat; $lng = $obj->results->location->lng; osv... /* Create columns('lat'),('long') IF not exist and update columns ('lat'),('long')*/ } } ?>
<?php require_once('../db.php'); $api_key = "din nyckel.." $sqlQuery = mysql_query("SELECT `County` FROM `ManualInsert_Infectious_Disease_Cases_by_County`"); /* Fetch county */ while($rows = mysql_fetch_array($sqlQuery)) { $countyArr = $rows['County']; /* Call google API and save coordinates for each county */ $json = get_file_contents("https://maps.googleapis.com/maps/api/geocode/json?address=$countyArr&key=$api_key"); $obj = json_decode($json); if ($obj->status == "OK") { $lat = $obj->results->location->lat; $lng = $obj->results->location->lng; osv... /* Create columns('lat'),('long') IF not exist and update columns ('lat'),('long')*/ } } ?>
<?php
require_once('../db.php');
$api_key = "somekey";
$sqlQuery = mysql_query("SELECT `County` FROM `ManualInsert_Infectious_Disease_Cases_by_County`");
$ch = curl_init();
/* Fetch county */
while($rows = mysql_fetch_array($sqlQuery)) {
$countyArr = $rows['County'];
/* Call google API and save coordinates for each county */
curl_setopt ($ch, CURLOPT_URL, "https://maps.googleapis.com/maps/api/geocode/json?address=".$countyArr.",+CA&key=".$api_key."");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$json= curl_exec($ch, true);
$obj = json_decode($json);
if ($obj->status == "OK") {
$lat = $obj->results->location->lat;
$lng = $obj->results->location->lng;
echo $lat;
/* Create columns('lat'),('long') IF not exist and update columns ('lat'),('long')*/
}
else{
echo "fail";
}
}
curl_close($ch);
?>
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106