From: root Date: Sat, 1 Mar 2025 01:33:03 +0000 (+0000) Subject: Bugfixes X-Git-Url: http://git.slightlycyberpunk.com%2C%20git.slightlycyberpunk.com/git/?a=commitdiff_plain;h=90d880800e936b15b9701ca0a330e1533a914f89;p=CCCP.git Bugfixes --- diff --git a/config.php b/config.php new file mode 100644 index 0000000..b016568 --- /dev/null +++ b/config.php @@ -0,0 +1,12 @@ + false, // Disable emulation mode for "real" prepared statements + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, // Make the default fetch be an associative array +]; +$dbh = new PDO("mysql:host=localhost;dbname=CCCP", "root", "yix", $options); +?> \ No newline at end of file diff --git a/taskRunner.php b/taskRunner.php index cff2e49..7469476 100644 --- a/taskRunner.php +++ b/taskRunner.php @@ -963,7 +963,7 @@ print_r($params); } $resCity = $resultsObj->features[0]->properties->city; $resState= $resultsObj->features[0]->properties->state_code; - $resZip = $resultsObj->features[0]->properties->postcode; + $resZip = substr($resultsObj->features[0]->properties->postcode,0,5); // Sometimes geoapify doesn't return a zipcode...not sure why...but we don't really need it anyway if( !isset($resultsObj->features[0]->properties->postcode) ) { echo "ERROR: Postcode not returned from geocoder.geoapify".PHP_EOL;