if (isset($_GET['location']) && strlen($_GET['location'])) {
    // Create a PDO Geocode Cache connection and pass it to the caching geocoder
    try {
        $geoPDO = new \PHPGoogleMaps\Service\GeocodeCachePDO('localhost', 'username', 'password', 'database');
    } catch (PDOException $e) {
        die('Unable to connect to database');
    }
    $caching_geo = new \PHPGoogleMaps\Service\CachingGeocoder($geoPDO);
    // Geocode the location with the caching geocoded
    $geocode_result = $caching_geo->geocode($_GET['location']);
    if ($geocode_result instanceof \PHPGoogleMaps\Core\PositionAbstract) {
        // Create a map
        $map = new \PHPGoogleMaps\Map();
        $marker = \PHPGoogleMaps\Overlay\Marker::createFromPosition($geocode_result);
        $map->addObject($marker);
        $map->disableAutoEncompass();
        $map->setZoom(13);
        $map->setCenter($geocode_result);
    } else {
        $location = $geocode_result->location;
        $error = $geocode_result->error;
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Geocoding - <?php 
echo PAGE_TITLE;