In this tutorial you will learn how to create your own Highscores for your games, using your own free server / database. Let's go! Here's an example of how the...
[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
Thank you. The data is inserted into the email column correctly, but when the user enters the higher score, it duplicated the data. It does not update it with the new score? It does not check if the email is already in the database.
Hey!
You can edit savescores.php to "insert" only new emails+score and "update" if existing email with the new scores.
ANother option is save eveything but getscores.php only returns the Best Score for each unique player(email). Something like this (your file extension must be .php):
duquekarlgames.000webhostapp.com/getscores-unique.txt
Let me know if that helps!
if I put this I get a blank page, because thanks
I don't have in my db max score table I have only score