How do I connect a db to my game?

  • I want the players to be able to save characters in cloud so they can load their characters on connection, so I am looking for a free db connection plugin

    It's obviously for a MMO game

    Thanks :)

  • Games are client side, you wouldn't want to directly connect to a DB through your game. You'd want to create a service and post AJAX requests etc to your service.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Games are client side, you wouldn't want to directly connect to a DB through your game. You'd want to create a service and post AJAX requests etc to your service.

    Thanks Tom! What kind of service could I use?

  • [SOLVED] I hosted a php file on 000webhost.com and all I had to do was request AJAX on it.

  • Your solution is pretty much how I'm handling it. Ajax requests are sent to various PHP files on a web server. The PHP files then make requests from a MYSQL database and echo the results which C3 picks up as the Ajax results.

    The problem with this method: It's not fast. Depending on the server load (shared hosting), or how much processing the PHP file has to do or ping times, it could be seconds before you get results back.

    Make sure that, if you need to, lock any controls to prevent repeatedly sending the Ajax request multiple times until the request gets and answer or it errors out.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)