Guest User

Untitled

a guest
Feb 7th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. $servername = 'localhost';
  3. $username = 'root';
  4. $password = '********';
  5. $dbname = 'mysqldb';
  6.  
  7. $connect = mysqli_connect($servername, $username, $password, $dbname);
  8. if ($connect == 0) {
  9. echo "SORRY SCORE SERVER CONNECTION ERROR";
  10. } else {}
  11.  
  12. mysqli_select_db($connect, $dbname);
  13.  
  14. $User_Id2 = $_POST["User_Id"];
  15. $User_Id = $User_Id2 + 0;
  16.  
  17. $sql = "select * from Users where User_Id = '".$User_Id."'";
  18. $result = mysqli_query($connect, $sql);
  19.  
  20. $rows = array();
  21. $return = array();
  22. while($row = mysqli_fetch_array($result)) {
  23. $rows['User_Id'] = $row['User_Id'];
  24. $rows['Dia_Qty'] = $row['Dia_Qty'];
  25. $rows['Fighter_Info'] = $row['Fighter_Info'];
  26. $rows['InvBonus'] = $row['InvBonus'];
  27.  
  28. array_push($return, $rows);
  29. }
  30.  
  31. header("Content-type:application/json");
  32. echo json_encode($return);
  33.  
  34. mysqli_close($connect);
  35. ?>
Add Comment
Please, Sign In to add comment