I have an application that has login screen and it will get user name and password first then whenever application will start, username and password will be checked from data base and after that i need some data to be fetched from database and display in iphone application. So how to integrate mysql data base with iphone app?
-
have a look at this. May be useful for you http://stackoverflow.com/questions/8178011/how-to-insert-only-one-username-and-password-in-sqlite-database/8178682#8178682 – Anil Kothari Mar 16 '12 at 05:46
-
you have given this for sqlite i don't need to use this – user1263350 Mar 16 '12 at 05:52
-
ok..i have not read the question properly. – Anil Kothari Mar 16 '12 at 05:55
-
its ok is it possible to get mysql data in xml format and then send back in xml formate to data base – user1263350 Mar 16 '12 at 05:59
-
Are you referring to the mysql database present on the server ? – pradyumnad Mar 16 '12 at 05:38
-
yes i have mysql data base on server – user1263350 Mar 16 '12 at 05:40
2 Answers
you can go through the tutorial for this
raywenderlich provided a great tutorial for this.

- 3,241
- 1
- 20
- 25
Check this http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/ tutorial for connectivity with sqlite.
You will not be able to connect to MySQL directly from the iPhone. You must use some intermediate layer such as a Web application with PHP.
So, you will have something like this:
iPhone POSTING a request to the WebServer using HTTP Web Server connecting to the MySQL database Web Server returning data to the iPhone (XML, plain text) iPhone processing the data You can use this technique to query and insert/update/delete data.
Once i found this library http://www.eval-art.com/2008/09/05/libmysqlclient-for-iphone-2/ for mysql, and i dont aware how it works.

- 339
- 1
- 14
-
It mean first i need to convert the data which i want from data base in xml and then parse in iphone app – user1263350 Mar 16 '12 at 05:41