Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. $dbname = $_GET['schema'];
  5. $host = $_GET['host'];
  6. $username = $_GET['user'];
  7. $pass = $_GET['pass'];
  8.  
  9. $uid = $_GET['uid'];
  10. $tbname = "xpsystem";
  11.  
  12. $port = $_GET['port'];
  13.  
  14. $host = $host . ':' . $port;
  15.  
  16. $querycheck = "select XP,Perks from $tbname WHERE PlayerUID = '$uid'";
  17.  
  18. $con = mysqli_connect($host,$username,$pass) or die("Unable to Connect");
  19. mysqli_select_db($con,$dbname);
  20.  
  21. $result = mysqli_query($con,$querycheck);
  22.  
  23. if(mysqli_num_rows($result)>0)
  24. {
  25. $columncount = mysqli_num_fields($result);
  26. $convertedresult = "";
  27. while ($row = mysqli_fetch_row($result)) {
  28. $convertedresult = $convertedresult . "[";
  29. for($i=0;$i < $columncount;$i++) {
  30. $convertedresult = $convertedresult . $row[$i] . ",";
  31. };
  32. $convertedresult = substr($convertedresult,0,-1);
  33. $convertedresult = $convertedresult . "],";
  34. };
  35. returndata(substr($convertedresult,0,-1));
  36. } else
  37. {
  38. $query = "INSERT INTO $tbname VALUES ('$uid',100,'[]')";
  39. mysqli_query($con,$query);
  40.  
  41. $result = mysqli_query($con,$querycheck);
  42. $columncount = mysqli_num_fields($result);
  43. $convertedresult = "";
  44. while ($row = mysqli_fetch_row($result)) {
  45. $convertedresult = $convertedresult . "[";
  46. for($i=0;$i < $columncount;$i++) {
  47. $convertedresult = $convertedresult . $row[$i] . ",";
  48. };
  49. $convertedresult = substr($convertedresult,0,-1);
  50. $convertedresult = $convertedresult . "],";
  51. };
  52. returndata(substr($convertedresult,0,-1));
  53. }
  54.  
  55. function returndata($dat)
  56. {
  57. echo '<data>'. $dat .'</data>';
  58. }
  59.  
  60. mysqli_close($con);
  61.  
  62. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement