Jump to content

echoing an old value after its been changed??


seany123

Recommended Posts

basically i have a value called

$member['money']

 

on this page i have

 

$moneyreduce = ($member['money']);

 

then i have a query which makes the value of $money become 0.

 

now i want to echo the amount taken away... if i try echoing $moneyreduce it just shows me the value of money after the query...(0)

 

can anyone explain how i can keep the old value?

<?php
$depamount = ($player->money);
//UPDATE STRENGTH.
if ($_POST['full_deposit'])
{
if($player->money < 1)
{
	echo"You have no money to deposit.";
}

$query = $db->execute("update `players` set `money`=?, `bank`=? where `id`=?", array($player->money - $player->money, $player->bank + $Player->money, $player->id ));

echo "You deposited $" <?($depamount)?> "into the bank.";
}
}
?>

 

So basically i want the amount to show the amount deposited... but instead it shows 0

Try

 

<?php
$depamount = ($player->money);
//UPDATE STRENGTH.
if ($_POST['full_deposit'])
{
if($player->money < 1)
{
	echo"You have no money to deposit.";
}

$query = $db->execute("update `players` set `money`=?, `bank`=? where `id`=?", array($player->money - $player->money, $player->bank + $Player->money, $player->id ));

echo "You deposited $depamount into the bank.";
}
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.