Creating your own Leaderboard / Highscores easy and free (PHP MySQL)

  • 37 favourites


Attached Files

The following files have been attached to this tutorial:



Download now 178.5 KB


21,816 visits, 57,426 views


In this tutorial you will learn how to create your own Highscores for your games, using your own free server / database. Let's go!

What do you need

- Your Construct 2 game

- A server with PHP and MySQL databases (you can get a free server on

- Download the PHP files

Let's start, step by step...

Registrating your new free server

A server is like a computer on internet where you can save your own data: pictures, files, databases, scores, games and many more things... If you have already hired a payed server (like HostGator), skip this step and move to the next page. Otherwise, follow these steps to get a free server where your databases will be stored with the scores of your users.

Go to On the right sidebar click "Sign Up" and register as a new user.

In the new page select "I will choose your free subdomain (recommended)" to create a free domain" (in case you don't have a server and want a free one). Type a name for your free domain, ie: c2tutorial-duquekarl

Fill your name, email and select a new password. When you are done you will receive a confirmation email, open your email account and Confirm your registration. The next step is to access your control panel.

Access your Control Panel

If you have already signed up and confirmed your free account, then you can log in to your account. To access your Control Panel, click Go to CPanel

Scroll down and you will find a lot of icons with options. We will see some of this useful options in this tutorial.


  • Order by
Want to leave a comment? Login or Register an account!
  • Great tutorial for a refresher. Ive just finished reading through the tutorial and will soon be implementing the PHP.

  • [FIXED] The scripts save/get should be updated according to the latest PHP formatting rules. After fiddling after a bit I found that in the save.php you should remove the "id" parts when inserting the score.

  • how do I show example: Your Position In Rank: 99

    how do I show an error if the player puts a name that has already registered in the database?

  • Have there been any updates to this - I copied it verbatim and am familiar with mYSQL and PHP a bit and this did not work for me - in terms of posting and retrieving scores? Also noticed another comment - that it wasnt saving?

  • cant save but the get score is working