-2

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

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. 

Update:---

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.

Thanks

Mann
  • 5,477
  • 6
  • 45
  • 57
  • 2
    A similar question has already been answered: http://stackoverflow.com/questions/468618/how-to-connect-to-a-mysql-database-from-an-iphone – Nathanial Woolls Aug 17 '11 at 12:07
  • 2
    The stack overflow is not your personal development team. Tell us what you have tried till now and what real problems you are facing and maybe you will get an answer. – Alex Terente Aug 17 '11 at 12:09
  • @Terente lonut Alexandru.. Agree but u being bit rude. but its ok. anyhow i am updating my question please have a look if u can suggest anything. thanks – Mann Aug 17 '11 at 12:14
  • @Manjinder S - No, Terente Ionut Alexandru is right on the money. Prepare an implementation... if you get stuck, then ask for help. The answer to your question is 'write a Web API', however this answer is probably as useful as your question without any implementation details. – John Green Aug 17 '11 at 12:24

1 Answers1

1

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.

feeela
  • 29,399
  • 7
  • 59
  • 71
  • Can you please suggest me any guide or tutorial to do that – Mann Aug 17 '11 at 12:22
  • Maybe I better should suggest a search-engine. Sorry, but it's triple-boring to search something for others, using Google, Bing, Yahoo, … – feeela Aug 17 '11 at 12:25