Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1.  
  2. function increasePoints($points, $mysqli, $user_check) {
  3.  
  4. $result = mysqli_query($mysqli,"SELECT rewardPoints FROM users WHERE username = '$user_check'");
  5. $item = mysqli_fetch_assoc($result);
  6. $currentPoints = $item['rewardPoints'];
  7.  
  8.  
  9. $newPoints = $currentPoints + $points;
  10.  
  11. $sqlupdate = "UPDATE users SET rewardPoints = '.$newPoints.' WHERE username = '$user_check' ";
  12. mysqli_query($mysqli, $sqlupdate);
  13.  
  14. echo "<p>you have ".$newPoints."</p>";
  15.  
  16.  
  17.  
  18. }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement