Creating your own Leaderboard / Highscores Easy and Free (PHP & MySQL) [UPDATED 2020]

You're viewing a single comment in a conversation. View all the comments
  • 7 Comments

  • Order by
  • What about if you want to post more data? Like email that also should be a unique value and it should update when the user plays the game again?

    name|email|score?

    • [Reply 2/2]

      Step 1:

      When you create the DB, add a new column email:

      `name` VARCHAR( 20 ) NOT NULL ,

      `email` VARCHAR( 60 ) NOT NULL ,

      `score` INT NOT NULL ,

      ---------

      Step 2:

      Edit savescores.php (BE VERY CAREFUL, do not copy this, just use as a guide of where to add 'email'):

      $name = strip_tags............ $_GET['name']));

      $email = strip_tags........... $_GET['email']));

      $score = strip_tags........... $_GET['score']));

      ....

      Now, the INSERT.. name, email, score

      VALUES $ name, $ email, $ score

      ----------

      Step 3: Similar to reading name from player and sending it to

      duquekarlgames.000webhostapp.com/savescores.php

    • [Reply 1/2]

      To save an 'email' in your High Scores is very similar to saving the player's 'name'.

      Read this tutorial and the PHPs and edit where you find 'name', then add 'email' too.

      Step 1: add column email to DB

      Step 2: edit savescores.php (and optionally getscores.php)

      Step 3: from C2/C3 send the email too