Advertisement
Guest User

Untitled

a guest
Jun 18th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?
  2. if(isset($_POST['reseta_wl'])) {
  3. $dbhost = '127.0.0.1';
  4. $dbuser = 'root';
  5. $dbpass = '';
  6.  
  7. $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  8.  
  9. if(! $conn ) {
  10. die('Could not connect: ' . mysql_error());
  11. }
  12.  
  13. $id = $_SESSION['s_usuario'];
  14.  
  15. $sql = "UPDATE game ". "SET credito = 30 ".
  16. "WHERE id = $id" ;
  17. mysql_select_db('gbwc');
  18. $retval = mysql_query( $sql, $conn );
  19.  
  20. if(! $retval ) {
  21. die('Could not update data: ' . mysql_error());
  22. }
  23. echo "Updated data successfullyn";
  24.  
  25. mysql_close($conn);
  26. } else {
  27. ?>
  28. <form method="post" action="<?php $_PHP_SELF ?>">
  29. <input type="button" name="reseta_wl" value="Resetar">
  30. </form>
  31. <?
  32. }
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement