Hi everyone! I want to create a PHP website with a MySql server, where users can register, login, and then get "coins" (like an arcade game). Then users can use those "coins" to play 3D webgames made with Unity.
Can I get the Unity webgames communicate with the MySql server, in order to send and retrieve data like username, login, number of available coins, etc?
asked May 26 '10 at 08:30 AM
You should use standard HTTP Get or Post requests, via Unity's WWW class, to send requests to your PHP scripts, and read the responses.
The PHP scripts on your server would then communicate with the Database, and perform tasks like checking whether a username is available, creating new accounts, logging in, retrieving account data, etc.
You should consider it in a similar way to how you would build it as if it had a simple web page based form interface, but instead of typing in the form values into text boxes, you pass them as values via scripts. The returned page can then contain the data in whatever format you want, for your game to process.
For more information, see this Question:
answered May 26 '10 at 01:27 PM
Yes you can with cs
Just use mysql connector for cs and import the MySql.Data.dll to your project.
Here is an example mysql connect script:
answered May 26 '10 at 08:43 AM