Hi a script that i use changes the status of my session and prints it but it doesn't change the information inside my database. Can somebody please help.

Thanks in advance!

<?
session_start();
?>
<?
$db_user = 'Berone';
$db_pass = 'moltres';

$connection = mysql_connect('localhost', $db_user, $db_pass) or die(mysql_error());
mysql_select_db('Berone', $connection) or die(mysql_error());

mysql_connect('localhost', $db_user, $db_pass) or die(mysql_error());
mysql_select_db('Berone', $connection) or die(mysql_error());

if ($_POST['inn'] == "stay") {
if ($Level == 1) {
$gold = $gold -25;
print "$gold";

     mysql_query( "UPPDATE users SET gold = '$gold' where user_name=$user_name" );

 } elseif ($_POST['inn'] == "leave") {
     header("Location: town.php");
     exit;
 }

}
?>

    Quotes are needed for user_name if it is a string and UPDATE is misspelled.

      I tried that but it still isnt updating my database any other suggestions?

        Write a Reply...