= 5) { // successful geocode $geocode_pending = false; $lat = $csvSplit[2]; $lng = $csvSplit[3]; $query = sprintf("UPDATE gforum_OpenWater " . " SET openwater_lat = '%s', openwater_lng = '%s' " . " WHERE openwater_id = %s LIMIT 1;", mysql_real_escape_string($lat), mysql_real_escape_string($lng), mysql_real_escape_string($id)); $update_result = mysql_query($query); if (!$update_result) { die("Invalid query: " . mysql_error()); } } else if (strcmp($status, "620") == 0) { // sent geocodes too fast $delay += 100000; } else if ($accuracy < 5) { // failure to geocode $geocode_pending = false; echo "Address " . $address . " did not geocode to great enough accuracy to be useful. "; echo "Accuracy match: " . $accuracy . " \n"; } else { // failure to geocode $geocode_pending = false; echo "Address " . $address . " failed to geocode. "; echo "Received status " . $status . " \n"; } usleep($delay); } } ?>