- Home /
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.
http://www.unifycommunity.com/wiki/index.php?title=Server_Side_Highscores
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
You probably need a webserver with both PHP and $$anonymous$$ySQL installed. You will setup the database and upload the PHP scripts there, not within Unity itself. From Unity, you will probably use WWWForm to post and fetch data to the PHP, which serves as a gateway to your $$anonymous$$ySQL database.
can i used phpmyad$$anonymous$$? I would appreciate you could provide more details how to do?
Answer by by0log1c · Mar 26, 2012 at 03:46 AM
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 freewebspace.ws 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.
initially i am using sqlite, but when i run the games on .exe file, it is not updating to sqlite. Any ideas why? It is because of the security problem??