Cocos 2dx and SQL to and from a database eg MySQL

Hi,

I am using Cocos 3.x on Windows 7, C++.

I would like to know how to connect to an SQL database eg MySQL
and select, insert, update and delete data using SQL.

Please let me know how I could go about doing this. Thanks

Cross Compile libpq for connecting PostgreSQL

Use the C++ connect drivers from mysql, uses boost libraries; App will very large

http://dev.mysql.com/downloads/file.php?id=412286

Note: Not Tested

Thanks, I will try that.
I would prefer to use MySQL.

But, what methods do mobile game apps generally use in this situation?
All games usually need to store the players data ‘in the cloud’,
ie on the game company’s server.

Sqlite3 for Windows Phone 8 game
A simple Tutorial How to use SQLite in cocos2d-x

Hi, thanks but I want to know how to connect to a database on a server.
SQLite is a serverless database. I need to connect to a server located
database such as MySQL. The idea is that player data is stored on the
server, because if it was stored on the players phone, it could be hacked
or modified by the player.

So anyone know any code for this, does it involve some kind of HTTP request/response and XML?

Generally you would send the player data via a POST request to the server and the script on the server side would add it to the database. Similarly a request would be made to the server to retrieve the user data. Clash of Clans uses something similar as they store all the data related to the player on their server. The downside is that the game works only when there is an active internet connection. On iOS, you could do something like this
http://stackoverflow.com/questions/16274450/how-to-send-data-from-ios-app-to-http-server

to send data from your game.

That’s probably the method I am going to have to use.
Will look into that route.

It is fine that the game will need an internet connection, this is expected these days.