How to use php to update mySQL

Hello, i am using mySQL to store all my data. So i am like following the tutorials which everyone have recommended,Server_Side_Highscores. So basically, there is a php script. May i know where should we put the script at? I doubt we need to attach the php script to an gameObject?? And regarding md5.js, do we have to attach to any gameObject.

Still very confusing about the process of using the server side highscore and would appreciate some kind soul can give me a brief instruction on how to use all the 3 files?

Thank you

I’ve never used this tutorial but I’ll try to give general advice to make it work. In case you just want to save data locally, SQLite might be a better solution, this tutorial is for saving data online.

  • You need a webserver with PHP and MySQL installed, I use but any will do.
  • Log into your cpanel and find the Database management section. Create a new database.
  • Administrate that database and run the SQL code provided in the tutorial to setup the database tables.
  • Upload addscore.php and display.php onto your webserver. There seem to be ‘improved version’ provided.
  • Don’t forget to edit the PHP scripts with your SQL database information provided within your cpanel.
  • Within Unity, add one of the HSController script depending on the language you use and have them point to your PHP scripts.

I didn’t test it myself but that’s probably how it works.