I tried to make a code here, but it did not work very well ... can you tell me where the error is?
<?
if(isset($_POST['reseta_wl'])) {
$dbhost = '127.0.0.1';
$dbuser = 'root';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$id = $_SESSION['s_usuario'];
$sql = "UPDATE game ". "SET credito = 30 ".
"WHERE id = $id" ;
mysql_select_db('gbwc');
$retval = mysql_query( $sql, $conn );
if(! $retval ) {
die('Could not update data: ' . mysql_error());
}
echo "Updated data successfully\n";
mysql_close($conn);
} else {
?>
<form method="post" action="<?php $_PHP_SELF ?>">
<input type="button" name="reseta_wl" value="Resetar">
</form>
<?
}
?>