GM:S 1.4 Online Highscores

Discussion in 'Tutorials' started by Appsurd, Aug 10, 2016.

  1. Jeffdev

    Jeffdev Member

    Joined:
    Nov 28, 2017
    Posts:
    5
    Do you have a discord or something else? I'm trying to DM the code through here but it's telling me it won't send because its "spam-like" :mad:
     
  2. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    Weird... I would prefer if you could email it. I'll send my mail in a private message.
    Have you considered putting your code between brackets
    Code:
     and 
    . That should work as well..
     
  3. Jeffdev

    Jeffdev Member

    Joined:
    Nov 28, 2017
    Posts:
    5
    Update on the situation, Appsurd was immensely helpful, and my problem is now solved and the online leaderboard works wonderfully. :D
     
  4. Jmation

    Jmation Member

    Joined:
    Apr 26, 2017
    Posts:
    22
    How simple is it to invert the leader board so lowest score (best time) is ranked first.
     
  5. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    In display.php change DESC (which stands for descending) to ASC (which stands for ascending).
     
  6. Relic

    Relic Member

    Joined:
    Jun 27, 2017
    Posts:
    720
    Been staring at this one for an hour.


    ___________________________________________
    ############################################################################################
    FATAL ERROR in
    action number 1
    of Draw Event
    for object obj_controller_score:

    Push :: Execution Error - Variable Index [0,8] out of range [1,8] - -7.str2(100008,8)
    at gml_Script_draw_text_highscore (line 38) - str3[i+1] = str2;
    ############################################################################################
    --------------------------------------------------------------------------------------------
    stack frame is
    gml_Script_draw_text_highscore (line 38)
    called from - gml_Object_obj_controller_score_Draw_0 (line 7) - draw_text_highscore(100,100,"Num","Player","Score",string(text2),global.name,c_green)

    While I understand the error suggests that accessing [0,8] is bad as the array only goes up to [0,7], line 38 of draw_text_highscore has a 1D array - not sure why I'm getting 2D array issues.

    Like Jeffdev, I have also have a blank high score table (from an older project though - doesn't have the same error above). It used to work, but now it doesn't - cleared my database but scores will no longer be added. Could it be the same issue?
     
  7. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    Please note that I updated the example from the Marketplace. Could you please check you are using the correct version?
     
  8. Relic

    Relic Member

    Joined:
    Jun 27, 2017
    Posts:
    720
    I used the code referenced in this forum thread (old project with empty tables from a year ago/yesterday for the error throwing project).

    Still worth trying the marketplace version?

    I am using GM:S 2 if that makes a difference.


    Edit: Tried the marketplace asset with the exact same error. I can't find any 2d arrays, neither in the draw highscore script or the string split script used.

    Issue with empty table is my password to the database had changed. That is now rectified.
     
    Last edited: Nov 20, 2018
  9. Relic

    Relic Member

    Joined:
    Jun 27, 2017
    Posts:
    720
    Problem solved.... my bad. Did not append the .php to the addscore and display files. I've said it in a previous comment, but I'll say it again - thanks for this resource and keeping it updated!
     
  10. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    Alright, no problem! Thanks for letting us know!
     
  11. Jmation

    Jmation Member

    Joined:
    Apr 26, 2017
    Posts:
    22
    Thanks for the php ( ASC) in inverting the leader board.

    Another question I have is about multiple leader boards for a game. I'll working on something that requires a leader board for 12 levels. Can this be done in one database or is it better to make 12 individual databases?
     
  12. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,549
    If the form of the score is consistent throughout the levels, then you should NOT use multiple tables. Instead, you should just add a single indexed column specifying the level that the score applies to. Then the SQL for insertion becomes:
    Code:
    INSERT INTO OnlineHighscores VALUES (NULL, :name, :score, :level)
    
    And the query for retrieval becomes:
    Code:
    SELECT * FROM OnlineHighscores WHERE level = :level ORDER BY score DESC
    
    Then all you need to do is to add the extra level parameter to your request on the GML side, and bind it to the statement on the PHP side.
     
  13. Jmation

    Jmation Member

    Joined:
    Apr 26, 2017
    Posts:
    22
    Thanks FrostyCat, I'll give it a go.
     
  14. Jmation

    Jmation Member

    Joined:
    Apr 26, 2017
    Posts:
    22
    I have everything working except for one problem. I can submit to the leader board with name,score,level. However when I try to retrieve the info the table in GameMaker is blank. If I change the code in display.php form:

    Code:
    $sql = "SELECT * FROM gamenameleaderboard WHERE level = :level ORDER BY score ASC";
    to

    Code:
     $sql = "SELECT * FROM gamenameleaderboard WHERE level = 11 ORDER BY score ASC";
    it works. So the variable :)level) I send is not getting process correctly? But it works fine for adding the data to the database.


    here is the gml code I'm using:
    Code:
    send score gml
    ===
    var name = url_encode(base64_encode(string(argument0)));
    var args = "name="+name+"&score="+string(argument1)+"&level="+string(argument2)+"&hash=1234";
    http_post_string("http://ftp.gamename.altervista.org/OnlineHighscores/addscore.php", args);
    
    Code:
    get score gml
    ===
    var name = url_encode(base64_encode(string(argument0)));
    var args = "name="+name+"&no_lines="+string(argument1)+"&level="+string(argument2)+"&hash=1234";
    get_highscores = http_post_string("http://ftp.gamename.altervista.org/OnlineHighscores/display.php", args);

    here is the php

    display.php
    ============
    Code:
    <?php
        // Connect to database
        $db = new PDO('mysql:host=localhost;dbname=my_gamename', 'gamename');
    
        // Check secret key, if correct, then get names and scores
        $has_found = 0;
        $secretKey = "1234";
        if($secretKey == $_POST['hash'])
        {
            // Get all data from the table, ordering from best to worst
            $sql = "SELECT * FROM gamenameleaderboard WHERE level = :level ORDER BY score ASC";
            $stmt = $db->prepare($sql);
            $stmt->execute();
    
            // Fetch the result into a nice format EXAMPLE: 1. Guest2837 100
            // no_lines is the length of the list, generally you will want a top 10
            $line = 1;
            $no_lines = $_POST['no_lines'];
            while($row = $stmt->fetch(PDO::FETCH_ASSOC))
            {
                // We only want a top no_lines
                if($line <= $no_lines)
                {
                      // Check if you are in the top no_lines
                      if($row['name'] == $_POST['name'])
                      {
                            $has_found = 1;
                      }
                      // Echo the top no_lines list
                      echo $line . ".-" . $row['name'] . "-" . $row['score'] . "|";
                      $line += 1;
                }
                else
                {
                    // When you are not in the top no_lines list, search for your record
                    if($has_found == 0)
                    {
                        if($row['name'] == $_POST['name'])
                        {
                            $has_found = 1;
                            echo $line . ".-" . $row['name'] . "-" . $row['score'] . "|";
                            break;
                        }
                        $line += 1;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            if($line <= $no_lines)
            {
                for($i = $line; $i<=$no_lines; $i++)
                {
                            echo $i . ".-" . "" . "-" . "" . "|";
                }
            }
        }
    ?>

    addscore.php
    ==================
    PHP:
    <?php
        
    // Connect to database
        
    $db = new PDO('mysql:host=localhost;dbname=my_gamename''gamename');

        
    // Check secret key, if correct, then insert name and score
        
    $secretKey "1234";
        if(
    $secretKey == $_POST['hash'])
        {
            
    // Prepare statement
            
    $sql "INSERT INTO gamenameleaderboard VALUES (NULL, :name, :score, :level)"// Change OnlineHighscores to your game name
            
    $stmt $db->prepare($sql);
            
    $stmt->bindParam(':name'$namePDO::PARAM_STR);
            
    $stmt->bindParam(':score'$scorePDO::PARAM_INT);
            
    $stmt->bindParam(':level'$levelPDO::PARAM_INT);

            
    // Get name, score and hash from URL string
            
    $name $_POST['name'];
            
    $score $_POST['score'];
            
    $level $_POST['level'];
            
            
    // Execute statement
            
    $stmt->execute();
            echo 
    '1';
        }
        else
        {
            echo 
    '0';
        }
    ?>
    Any help would be great as I have no clue what is wrong.
     
  15. Jmation

    Jmation Member

    Joined:
    Apr 26, 2017
    Posts:
    22
    Wow, figured it out. If anyone else needs to know just change the display.php file. You'll see I had to create a variable "currentlevel" before using it in the string.

    PHP:
            // Get all data from the table, ordering from best to worst
            
    $currentlevel $_POST['level'];
            
    $sql "SELECT * FROM thegamename WHERE level =$currentlevel ORDER BY score ASC";
            
    $stmt $db->prepare($sql);
            
    $stmt->execute();
     
  16. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    That works, but it's not advisable. Now you do not make use of the bindParam functions, which prevents users providing strange input.

    Instead, the actual problem is that you forgot to actually define :level in display.php. To be specific, you need to insert
    Code:
    $stmt->bindParam(':level', $level, PDO::PARAM_INT);
    
    and
    Code:
    $level = $_POST['level'];
    
    On the correct position in display.php. It's up to you to find out where ;)
     
  17. Jmation

    Jmation Member

    Joined:
    Apr 26, 2017
    Posts:
    22
    Yes I know, I decided to deal with the level input in game rather than php as I was running out of time but thanks for the info. I'll definitely fix the code in the next few days, thanks again.
     
    Appsurd likes this.
  18. Ivankov

    Ivankov Member

    Joined:
    Aug 13, 2016
    Posts:
    22
    I having an issue. I downloaded your tutorial demo from the marketplace. I inserted my servers info, however when I run it , its not updating the high score list with the current in game score. It appears to just refresh the blank high score list.

    This happens when using my server and also the altervista server. The database on both servers doesn't update with anything when I run your example game.
     
    Last edited: Dec 26, 2018
  19. GoliBroda

    GoliBroda Member

    Joined:
    Oct 25, 2016
    Posts:
    159
    Yeah, i got same issue. It connects to the database but high score list is empty. Could you give a hand, im very confused.
    Here are how i edited php codes:
    Code:
    <?php
        // Connect to database
        $db = new PDO('mysql:host=localhost;dbname=id1271297_uhaszysz', 'id1271297_uhaszysz','uhaszysz11');
    
        // Check secret key, if correct, then insert name and score
        $secretKey = "1234";
        if($secretKey == $_POST['hash'])
        {
            // Prepare statement
            $sql = "INSERT INTO otest VALUES (NULL, :name, :score)"; // Change OnlineHighscores to your game name
            $stmt = $db->prepare($sql);
            $stmt->bindParam(':name', $name, PDO::PARAM_STR);
            $stmt->bindParam(':score', $score, PDO::PARAM_INT);
    
            // Get name, score and hash from URL string
            $name = $_POST['name'];
            $score = $_POST['score'];
    
            // Execute statement
            $stmt->execute();
            echo '1';
        }
        else
        {
            echo '0';
        }
    ?> 
    Code:
    <?php
        // Connect to database
        $db = new PDO('mysql:host=localhost;dbname=id1271297_uhaszysz', 'id1271297_uhaszysz','uhaszysz11');
    
        // Check secret key, if correct, then get names and scores
        $has_found = 0;
        $secretKey = "1234";
        if($secretKey == $_POST['hash'])
        {
            // Get all data from the table, ordering from best to worst
            $sql = "SELECT * FROM otest ORDER BY score DESC";
            $stmt = $db->prepare($sql);
            $stmt->execute();
    
            // Fetch the result into a nice format EXAMPLE: 1. Guest2837 100
            // no_lines is the length of the list, generally you will want a top 10
            $line = 1;
            $no_lines = $_POST['no_lines'];
            while($row = $stmt->fetch(PDO::FETCH_ASSOC))
            {
                // We only want a top no_lines
                if($line <= $no_lines)
                {
                      // Check if you are in the top no_lines
                      if($row['name'] == $_POST['name'])
                      {
                            $has_found = 1;
                      }
                      // Echo the top no_lines list
                      echo $line . ".-" . $row['name'] . "-" . $row['score'] . "|";
                      $line += 1;
                }
                else
                {
                    // When you are not in the top no_lines list, search for your record
                    if($has_found == 0)
                    {
                        if($row['name'] == $_POST['name'])
                        {
                            $has_found = 1;
                            echo $line . ".-" . $row['name'] . "-" . $row['score'] . "|";
                            break;
                        }
                        $line += 1;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            if($line <= $no_lines)
            {
                for($i = $line; $i<=$no_lines; $i++)
                {
                            echo $i . ".-" . "" . "-" . "" . "|";
                }
            }
        }
    ?> 
    Also in those 2 scripts in gamemaker where you put your link can link start with https:// ??
     
    Last edited: Jan 2, 2019
  20. BigBrotherBear

    BigBrotherBear Member

    Joined:
    Sep 17, 2016
    Posts:
    6
    It may not be difficult, but it's a great start for someone just starting out.
     
  21. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    Hi there,

    I will answer your question in a private message.

    Hi there,

    Why do you insert three arguments on this line? Moreover, you to check, did you choose id1271297_uhaszysz as a user name? Also, never publish your password on a online forum!!
    Carefully reread the tutorial (especially Chapters 1 and 2) to find out which parameters you need to apply.

    Certainly. Do you have your own domain? I do, and it works perfectly so this should be working. Please contact me via PM or drop a comment here in case you need some help. Happy holidays!

    Thank you very much! If you have some spare time, would you mind rating it in the Marketplace? https://marketplace.yoyogames.com/assets/4205/online-highscores-example
    Happy new year!
     
    Last edited: Jan 2, 2019
  22. GoliBroda

    GoliBroda Member

    Joined:
    Oct 25, 2016
    Posts:
    159
    Hello brother, ty for anwser.
    In your tutorial you said if i do not use altervista then i need to add my password as a third argument. im not sure if i done this correctly.

    And yes, those are my corret parameters copied from server admin panel.
    Code:
        $db = new PDO('mysql:host=localhost;dbname=id1271297_uhaszysz', 'id1271297_uhaszysz','uhaszysz11');
    
    in this line i put: host,db name,db username,db password
     
    Last edited: Jan 2, 2019
  23. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    Aha, I didn't understand you were not using Altervista. Then it should be fine I guess. However, I want to stress again:
    Never share your password online, please remove it ASAP.
    Please send me a private message with your GameMaker codes as well, something must have gone wrong there..
     
  24. hijong park

    hijong park Member

    Joined:
    Dec 29, 2016
    Posts:
    126
    It seems this tutorial doesn't work anymore. The example can't load the highscore list, and I can't create an account on Altervista. It keep causing an unknown error when I try to make an account.

    GMscoreboard, an online highscore servise site had been shutdown for unknown reason a few days ago as well and there's no hope for it to be repaired.

    I think Steam leaderboard is the only option available now...
     
  25. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    Hi there,
    Thanks for trying my tutorial, however I disagree.

    Creating on account on Altervista should be possible, at least the make-a-blog-and-then-convert option as explained in Chapter 1.
    The example doesn't work indeed, because I had to shut it down due to people uploading names/points combinations which were unwanted. This is described in Chapter 4 as well... I would suggest rereading the tutorial carefully again, seems you missed some bits :)

    GMScoreboard is way different. Above all, it's insecure and you have no control whatsoever. With this method, you can change/improve anything you like. Yes, it imples you need to do some more work, but I never told it was going to be easy :)

    Steam leaderboards is, just as it says, for Steam. There are various other options in the field, including Gamejolt (PC), Google Play Games (Android), Apple's Game Center (iOS), and many more. The main difference is: here you are in charge, and independent of what kind of service they deliver.
     
  26. hijong park

    hijong park Member

    Joined:
    Dec 29, 2016
    Posts:
    126
    I have released 5 games on steam and all of my games have online scoreboard. I was using GMscoreboard for them, but as i mentioned, the service had been shutdown all of sudden and the scoreboard doesn't work amymore. So I must fix them as soon as possible or I'll probably have to delete my games.

    I looked for alternative lesderboard tutorials and this tutorial was the only one, but unfortunately trying to make an account on Altervista says "unknown error happened", No matter how many times i try it in every internet browsers (internet explorer, chrome, firefox, etc). So I thought this tutorial is not working. I searched for applying steam leaderboard as well, but I can figure out how to apply it and there's no tutotial about it.

    If I can't use Altervista, is it possible to use other websites ?
     
  27. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    You can use any website, even your own (if you have one). The procedure is 100% the same, you only need to figure out where you need to put everything but that's pretty doable.
    Still I believe Altervista will work, but nothing is obligatory :)
     
  28. hijong park

    hijong park Member

    Joined:
    Dec 29, 2016
    Posts:
    126
    Thanks for the info, Then I'll use the other website.

    Gmscoreboard had been restored fortunately, so I'll use this tutorial for my new project.
     
    Appsurd likes this.
  29. Raoul

    Raoul Member

    Joined:
    Dec 13, 2018
    Posts:
    37
    Hello,
    Thanks a lot to Appsurd for this superb guide and the improvements points raised by Frosty cat.

    I have one doubt though, it's related to the way data is passed to the PHP script.

    Focusing only on the 'Post' part, if I do a simple Wireshark captire I can read in clear the string passed to the php script responsible to check the data and eventually save the new score.

    If I then use Wget and simply send the following command line:
    wget http://ftp.tutorialappsurd.altervista.org/OnlineHighscores/addscore.php --post -data "name=Rocco&score=999999990&hash=1234" I am able to send any arbitrary data for name and score.

    Not sure if this has been discussed already here?
    I think it could be worth adding a cypher to the args var so that it is then translated back to correct values at the php script level?
    Just my 2 cents
     
    Last edited: Feb 18, 2019
  30. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    @Raoul I actually did. Under Known Issues, the following text is shown:

    In sort, two things. 1. The tutorial is basic, and this requires too much work for the tutorial to be basic. Moreover, for most users this is enough anyway.
    2. A solution is not that simple. Your suggestion of adding a cypher is not that simple, as you would need to change your key everytime you do a new request (otherwise you can perform the attack anyway). Moreover, this should be a safe cipher in terms of being hard to decrypt and does not simply 'obfuscate' the data. Taking the two together, I would advice users the following:

    1. If you want a simple highscore list which you can control yourself, and you are not too worried about data manipulation of any kind, this tutorial paves a simple way of creating your own highscores.
    2. If you are more worried and don't mind being less flexible, you could use services of other programs, including Google Play Games, Gamejolt, and many more. Just find out for yourself what you prefer!
     
  31. shredmer

    shredmer Member

    Joined:
    May 10, 2019
    Posts:
    1
    Thanks for creating this tutorial. It has been incredibly helpful for a beginner like myself to include high scores in my game. I can confirm this code is working, also for HTML5 (make sure to include the header code). I am using GMS2 and Altervista.

    I tried using hostgator to set up the DB but I couldn't figure out the correct url to use for the http_post_string event in GameMaker. If anyone knows what this URL would be, that would be helpful as I would prefer to use my existing hosting over Altervista.

    But for now, everything works!
     
  32. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    Do you have your own website? Then you can place the files whereever you want. Just be sure to direct to your site directly
     
  33. FKProjects

    FKProjects Member

    Joined:
    Jul 3, 2019
    Posts:
    4
    Hey, first of all thanks for the great Tutorial.
    So I made a game similar to Tri Tower Solitaire and the Highscores were working fine for a month or so.
    But since yesterday some devices cant send and get highscores, while others work fine. They all use the same version of the game. Its like Altervista blocked them for some reason.
    Maybe u have an idea what issue it could be?

    Thanks anyway.
     
  34. FKProjects

    FKProjects Member

    Joined:
    Jul 3, 2019
    Posts:
    4
    I get an IOException but only those few Devices
     
  35. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    @FKProjects You are sure that all users have access to the Internet? The error IOException generally means that you have a bad internet connection.
    And I have never experienced Altervista blocking particular users.
     
  36. FKProjects

    FKProjects Member

    Joined:
    Jul 3, 2019
    Posts:
    4
    Yes one thing is the problem started after they used the same wifi. Since then it doesnt work with any wifi on these devices. But before that Altervista had no problem with that wifi for months.
     
  37. FKProjects

    FKProjects Member

    Joined:
    Jul 3, 2019
    Posts:
    4
    Ok it must have to do something with Altervista blocking every device that connects over my wifi. When I try to load test data from other sites it works just fine. And people who use my app and were never connected to my wifi can load the highscores. But why did it start yesterday? I mean Ive been using this Highscore system for over a month now.

    Edit: And it seems like only mobile phones from my wifi are getting blocked. Highscores on PC are still working.
     
    Last edited: Jul 3, 2019
  38. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    I cannot point my finger at it at all... Please wait for some days and then try it again. When the issue persists, please send me a PM. ;)
     
  39. pipebkOT

    pipebkOT Member

    Joined:
    Dec 13, 2018
    Posts:
    210
    @Appsurd the url_encode script gives me a error in gms 2, at line 14, "unterminated string literal"

    Code:
    special_chars = "$&+,/:;=?@ " + '"' + "'<>#%{}|\^~[]`!";

    if i delete ' " ' + the error goes away, but still can't manage to send successfully a score to the altervista database.

    edit1: since gms2 don't accept single quotations anymore i replaced it with " /" "
     
    Last edited: Jul 13, 2019
  40. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    @pipebkOT I have never seen such an error before... But I don't use GMS2 anyway, so that could be the issue.

    Still you should be able to use the stuff. Do you receive anything? Do you see any scores appearing in the database? Perhaps it's better to send a PM :)
     
  41. pipebkOT

    pipebkOT Member

    Joined:
    Dec 13, 2018
    Posts:
    210
    nevermind, it works, thank you for your tutorial :)


    @Appsurd
    edit 1 how can i overwrite scores linked to the user id?

    i read somewhere that insert ... on duplicated key update. could do the trick but i don't know how to implement it

    $sql = "INSERT INTO OnlineHighscores VALUES (uid, :name, :score)";

    ON DUPLICATE KEY UPDATE
     
    Last edited: Jul 13, 2019
  42. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
  43. pipebkOT

    pipebkOT Member

    Joined:
    Dec 13, 2018
    Posts:
    210
    @Appsurd
    yeah i get the logic behind the id and all, is the php part that is complicated

    it should look like this?



    Code:
            $sql = "INSERT INTO OnlineHighscores VALUES ( :userid,:name, :score)"
            ON DUPLICATE KEY UPDATE name=:name, score=:score;
    
    ///rest of the original send score script
    
    

    i can't figure it out, i searched everywhere and in every post on forums they define the values in differents ways

    what im trying to do the create/update scores using the same script, it creates the values in the database, and if they userid already exist it updates them, .

    maybe it fails because "on duplicate key update" may not be an php function, but a sql function :confused:
    i don't know
     
    Last edited: Jul 14, 2019
  44. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,549
    First make sure that your user ID column is set as a primary key or has a unique constraint, then use REPLACE instead of INSERT and get rid of the ON DUPLICATE. This is not a PHP issue, this is a SQL issue.

    See: REPLACE syntax
     
  45. pipebkOT

    pipebkOT Member

    Joined:
    Dec 13, 2018
    Posts:
    210
    so REPLACE replaces but also insert? perfect ,thank you:) that will solve it

    edit: yeah it solve it.

    yeah, i made sure to set the id to unique and primary,
     
    Last edited: Jul 14, 2019
  46. Tilapia

    Tilapia Member

    Joined:
    Jul 17, 2019
    Posts:
    7
    @Appsurd
    i had a problem when i create a host on 000webhost.com
    All name and score not update on my database and i always had a empty highscore table. I think the addscore.php or display.php can't connect my database. Pls show me this connect code right or wrong:

    $db = new PDO('mysql:host=localhost;dbname=id10831116_game_ranking','id10831116_rophi','password');

    i attach one more pic of my database
     

    Attached Files:

  47. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    236
    Awesome! Also many thanks to @FrostyCat to help out!

    I will answer your question via a private message.


    ----------------------------------------------------------------

    Changes:

    Minor update V1.1.7:
    - Thanks to HayManMarc, a clearification was added for non-Altervista users

    Coming up:

    Since a few weeks, I have a copy of GMS2, so I have plans to update this tutorial for GMS2. This would also imply that the current GMS1.4 version will be removed. So for GMS1.4 users: backup this tutorial now, I might be removing it in the (near) future.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice