Access a MySQL database via C# ?

Hello there !

Well, for some prototyping purpose, I would like to access a MySQL database via C# scripts in Unity. I’m wondering what is the best way to do that, the easier, the most secure etc. So to your mind, should I :

  • use MySQL connector and MySql .NET classes ?
  • use WWW Unity Class and PHP scripts located on my server ?

Thanks in advance for your advices !

We are using the WWW Unity Class and PHP scripts because that’s the only solution for developing on indie iOS. I also think it’s a bit more secure, since your MySQL login information will be on your site in the PHP code, not in the client code.

I’d vote use WWW and PHP.

If you’re building a standalone application that connects directly to a MySQL, I’d vote for C# .Net classes, you have more control and can build in additional security precautions into your application like a password randomizer or something. But mileage varies with the target platform and game design.