Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public string db_url="http://localhost/";
  2. IEnumerator SaveAllPlayerPrefs(object[] parms)
  3. {
  4. string ourPostData = "{"bone":"42"}";
  5.  
  6. Hashtable headers = new Hashtable();
  7. headers.Add("Content-Type", "application/json");
  8. headers.Add("Cookie", "Our session cookie");
  9.  
  10. byte[] pData = System.Text.Encoding.UTF8.GetBytes(ourPostData);
  11.  
  12. WWW webRequest = new WWW(db_url + "SaveAllPlayerPref.php", pData, headers);
  13.  
  14. yield return webRequest;
  15. }
  16.  
  17. <?php
  18. $sql_connect = mysql_connect("localhost", "root", "") or die ("no DB Connection");
  19.  
  20. mysql_select_db("example") or die ("DB not found");
  21.  
  22. $bone = $_POST['bone'];
  23.  
  24. mysql_query("INSERT INTO save_game (bone) VALUES ('$bone');");
  25.  
  26. mysql_close($sql_connect);
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement