Upgrading to PHP 8.1 killed saving scores online

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Apparently with upgrading PHP 8.1 a lot of the commands in the score saving php script that Jeff wrote have been depreciated (or annoyingly changed from mysql... to mysqli... and some arguments needing to be added to certain commands.)

    I do not know anything about php or coding in general but I have been trying to update the script by reading the error log, googling the error and changing the line.

    I have fixed most of the errors but now the only errors I get are related to these two array keys not being defined and I have not been able to solve this via google.

    Code
    [27-Jan-2023 06:41:32 America/Chicago] PHP Warning:  Undefined array key "status" in /home1/(my server name)/public_html/apps/scores/score_script.php on line 78
    [27-Jan-2023 06:41:32 America/Chicago] PHP Warning:  Undefined array key "gameid" in /home1/(my server name)/public_html/apps/scores/score_script.php on line 87
    [27-Jan-2023 06:41:57 America/Chicago] PHP Warning:  Undefined array key "status" in /home1/(my server name)/public_html/apps/scores/score_script.php on line 78
    [27-Jan-2023 06:41:57 America/Chicago] PHP Warning:  Undefined array key "gameid" in /home1/(my server name)/public_html/apps/scores/score_script.php on line 87

    I have pasted the code with my fixes below. Does anyone have any knowledge of PHP 8.1 and able to help out?

  • I'm working with PHP nearly every day.

    It looks like it is not even PHP 7 compatible. All mysql_... should be mysqli_... (with an i) and some need the database connection in the first parameter ($db) but not the ones you added them ;)

    Everything should work fine now. Please let me know if not.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!