【发布时间】:2015-03-23 18:05:28
【问题描述】:
我对我的 Google Maps API 有疑问。我正在使用一个简单的地理编码脚本从我的服务器中提取一个 txt/xml 文件并对地址进行地理编码。我遇到了地址作为空值返回并破坏脚本和我的数据库的问题,因为 coord_lat 和 coord_long 是浮点数并且不能接受空值。
我收到的错误是:Warning: file_get_contents(http://maps.google.com/maps/geo?key=AIzaSyBmT9F_ixjLlW8oDiYVqgHqt14a008kXwc&output=xml&q=131+rochestor+ave+039482) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /includes/sfupdate/func.php on line 294 {"status":"Failed","data":"SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'coord_lat' cannot be null"}
ErrorSyntaxError: Unexpected token
这是我与 Google Maps API 连接的问题吗?我看到 HTTP 请求失败,这让我相信我被拒绝了,并且地址因此返回空值。建议将不胜感激,谢谢。
【问题讨论】:
标签: php mysql http request geocode