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?
我有一个具有登录屏幕的应用程序,它将首先获得用户名和密码,然后每当应用程序启动时,将从数据库中检查用户名和密码,之后我需要从数据库中获取一些数据并在iphone应用程序中显示。那么如何将mysql数据库与iphone app集成?
3 个解决方案
#1
1
you can go through the tutorial for this
你可以通过这个教程
raywenderlich provided a great tutorial for this.
raywenderlich为此提供了一个很好的教程。
#2
1
Check this http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/ tutorial for connectivity with sqlite.
请查看http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/教程,了解与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.
您将无法直接从iPhone连接到MySQL。您必须使用某些中间层,例如使用PHP的Web应用程序。
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.
iPhone使用连接到MySQL数据库的HTTP Web服务器向WebServer发送请求Web服务器将数据返回到iPhone(XML,纯文本)iPhone处理数据您可以使用此技术查询和插入/更新/删除数据。
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.
有一次我发现这个库http://www.eval-art.com/2008/09/05/libmysqlclient-for-iphone-2/ for mysql,我不知道它是如何工作的。
#3
#1
1
you can go through the tutorial for this
你可以通过这个教程
raywenderlich provided a great tutorial for this.
raywenderlich为此提供了一个很好的教程。
#2
1
Check this http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/ tutorial for connectivity with sqlite.
请查看http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/教程,了解与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.
您将无法直接从iPhone连接到MySQL。您必须使用某些中间层,例如使用PHP的Web应用程序。
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.
iPhone使用连接到MySQL数据库的HTTP Web服务器向WebServer发送请求Web服务器将数据返回到iPhone(XML,纯文本)iPhone处理数据您可以使用此技术查询和插入/更新/删除数据。
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.
有一次我发现这个库http://www.eval-art.com/2008/09/05/libmysqlclient-for-iphone-2/ for mysql,我不知道它是如何工作的。