x


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

more ▼

asked Mar 26 '12 at 02:54 AM

missypooh gravatar image

missypooh
77 33 48 50

You probably need a webserver with both PHP and MySQL 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 MySQL database.

Mar 26 '12 at 03:08 AM by0log1c

can i used phpmyadmin? I would appreciate you could provide more details how to do?

Mar 26 '12 at 03:32 AM missypooh
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Mar 26 '12 at 03:46 AM

by0log1c gravatar image

by0log1c
2.1k 6 9 18

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??

Mar 26 '12 at 03:56 AM missypooh
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5273
x241
x136
x104

asked: Mar 26 '12 at 02:54 AM

Seen: 1095 times

Last Updated: Mar 26 '12 at 03:56 AM