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?

Link to comment
Share on other sites

<?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

Link to comment
Share on other sites

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.";
}
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.