Advertisement
Guest User

Untitled

a guest
Mar 10th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2.  
  3. $host = "host";
  4. $user = "user";
  5. $pass = "pass";
  6. $database = "database";
  7.  
  8. $username = $_POST['username'];
  9. $exp = $_POST['exp'];
  10.  
  11. $db = mysqli_connect($host,$user,$pass,$database) or die ('ERROR: Could not connect to database!');
  12. mysqli_select_db($db, $database) or die ("ERROR: Could not connect to database!");
  13.  
  14.  
  15. {
  16. $ins = mysqli_query($db, "UPDATE UserInfo SET xp=xp+" . $exp . " WHERE username = '".$username."';");
  17. if ($ins)
  18. {
  19. echo "Succesfully Updated!";
  20. }
  21. else
  22. {
  23. die ("Error!" . mysql_error());
  24. }
  25. }
  26.  
  27.  
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement