tags:

views:

2264

answers:

2

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  A: 

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:

  1. iPhone POSTING a request to the WebServer using HTTP
  2. Web Server connecting to the MySQL database
  3. Web Server returning data to the iPhone (XML, plain text)
  4. iPhone processing the data

You can use this technique to query and insert/update/delete data.

Pablo Santa Cruz
+1  A: 

This site contains a libmysqlclient.a file compiled for the iphone (arm).

http://www.eval-art.com/2008/09/05/libmysqlclient-for-iphone-2/

Stephan Looney