iPhone 应用程序从 Mysql 数据库中获取数据 [英] iPhone application Getting data from Mysql database

查看:56
本文介绍了iPhone 应用程序从 Mysql 数据库中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建商店定位器应用程序.此应用程序应显示距离给定纬度和经度最近的商店.

I am creating store locator application. This application should show nearest store to given latitude and longitude.

我可以获取纬度和经度.我在服务器上的 Mysql 数据库中有数据,其中包含有关商店及其相应纬度和经度的信息.

I can get latitude and longitude. I have data in my Mysql database on server containing information regarding stores and their corresponding latitude and longitudes.

1. Is it secure to connect MySQL database through application(because i have to connect to database to get nearest stores through Haversine formula.). 
2. how can i implement whole process. 

更新:---

到目前为止,我基本上可以获得我的位置坐标,如经度和纬度.我可以使用 googlePlaces 以表格形式获取最近的商店,但我也想添加开放和关闭时间.所以我在考虑连接包含所有信息的 mySql 数据库.但重点是获得最近的商店.我搜索了很多,发现有一个半正弦公式.我找到了使用带有 php 和 mysql 的半正弦的教程.但我不知道 php.So 请给我建议我可以完成的任何方式.

Basically i till now i can get my location coordinates like longitude and latitude. I can get nearest stores in table form using googlePlaces but i want to add opening and closing time as well. So i was thinking about connecting mySql database having all information. But main point is getting nearest stores. I have searched a lot and found there is haversine formula for that. i have found tutorial using haversine with php and mysql. but i dont know php.So please suggest me any way with which i can accomplish this.

谢谢

推荐答案

通常您会使用网络服务(通过 SOAP、REST、JSON 等)执行此类任务,因为这会阻止向公众开放数据库服务器并还使您独立于所使用的编程语言.

Normally you would use a webservice (via SOAP, REST, JSON, …) for such tasks, as this would prevent opening the database-server to the public and also makes you independent from the used programming language.

这篇关于iPhone 应用程序从 Mysql 数据库中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆