katarra Posted March 23, 2010 Share Posted March 23, 2010 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"; } Link to comment https://forums.phpfreaks.com/topic/196301-taking-from-one-player-to-give-to-another-help/ Share on other sites More sharing options...
katarra Posted March 24, 2010 Author Share Posted March 24, 2010 *bump* Any ideas? Link to comment https://forums.phpfreaks.com/topic/196301-taking-from-one-player-to-give-to-another-help/#findComment-1030990 Share on other sites More sharing options...
TeddyKiller Posted March 24, 2010 Share Posted March 24, 2010 Note to people who sort this out, this is somewhat related to my thread. The update queries don't update.. but no errors or anything occur. Link to comment https://forums.phpfreaks.com/topic/196301-taking-from-one-player-to-give-to-another-help/#findComment-1031033 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.