Jump to content

taking from one player to give to another HELP


katarra

Recommended Posts

Okay, so, I'm trying to create a script where it'll take money from the person playing a game (card pick) and give the gold to the owner of the casino when the player loses. If the player wins, then the gold is taken from the casino owner. In this instance, the casino owner goes by the username Zelig.

 

Thanks in advance!

 

if($draw == $_POST['number'])
		{
			$query = $db->execute("update `users` set `gold`=? where `id`=?", array($player->gold + ($_POST['betmb'] * 6), $player->id)) or die("Query failed: ".mysql_error());
$qfsad = $db->execute("select * from `users` where `username` = 'Zelig'") or die("Query failed: ".mysql_error());
$ads = $qfsad->fetchrow();
$query1 = $db->execute("update `users` set `gold`=? where `username`='Zelig'", array($ads['gold'] - $_POST['betmb'])) or die("Query failed: ".mysql_error());
		}
		else
		{
			$query = $db->execute("update `users` set `gold`=? where `id`=?", array($player->gold + ($_POST['betmb'] * 6), $player->id)) or die("Query failed: ".mysql_error());
$qfsad = $db->execute("select * from `users` where `username` = 'Zelig'") or die("Query failed: ".mysql_error());
$ads = $qfsad->fetchrow();
$query1 = $db->execute("update `users` set `gold`=? where `username`='Zelig'", array($ads['gold'] + $_POST['betmb'])) or die("Query failed: ".mysql_error());
			$bnmessage = "<font color=\"red\">Your guess was wrong! You lost " . $_POST['betmb'] . " Gold!</font>\n";
		}

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.