问题
I am working on project and i need to connect MYSQL database. I am success to connect SQLite in my project ( using cocos2d).But i can not connect MYSQL database in my project. I any one do like this than help me for how to connect . Give me the necessary information.
回答1:
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.
回答2:
This site contains a libmysqlclient.a file compiled for the iphone (arm).
http://www.eval-art.com/2008/09/05/libmysqlclient-for-iphone-2/
来源:https://stackoverflow.com/questions/673300/how-can-i-use-mysql-database-connection-in-iphone-application-useing-cocos2d