- Home /
Proplem with loaddata from php
This is my fisrt post and My english isn't very well . I try to load data from mySQL with php . Now I can't save and load but where I'm loaddata there have html come with them too
like this ,

and this is my code
public class TEST_MySQL : MonoBehaviour { public GameObject myGui;
public string _name=null;public string _num;public string[] _data;public string _test;IEnumerator SaveScores(string test,string testscore){WWWForm form = new WWWForm();form.AddField("Username", test);form.AddField("Score", testscore);WWW webRequest = new WWW("http://toonhamla.host22.com/linker.php",form);yield return webRequest;print("Save Complete");}IEnumerator Loaddata(){WWWForm form = new WWWForm();WWW webRequest = new WWW("http://toonhamla.host22.com/linker_read.php");yield return webRequest;myGui.guiText.text = webRequest.text;}void OnGUI(){if(GUI.Button(new Rect(10, 100, 100, 20), "Save Data"))StartCoroutine(SaveScores(_name,_num));if(GUI.Button(new Rect(10, 150, 100, 20), "Load Data"))StartCoroutine(Loaddata());GUI.Label(new Rect(10,50,100,20),"Input Name");GUI.Label(new Rect(10,50,100,20),"Input Name");_name = GUI.TextField(new Rect(10,70,100,20),_name,5);GUI.Label(new Rect(120,50,100,20),"Input Score");_num= GUI.TextField(new Rect(120,70,100,20),_num,5);}}
php.png
(26.7 kB)
Comment
Your answer
Follow this Question
Related Questions
Save the inventory items to the database 0 Answers
How can I continue the game without losing values after Game Over? 1 Answer
save load exp on database 2 Answers
Saving and loading game with PlayerPrefs 1 Answer
in game menu for load, save, quit to main menu scene and volume. also a question on opening scenes 1 Answer