seany123 Posted September 18, 2008 Share Posted September 18, 2008 Okay so for my game i have many different Houses people can buy and move into. What i need help with is how do i make it so when i click on the link to buy a house... It takes away 10000 'gold' from 'players' table, it makes the 'maxawake' go up to 210 in the 'players' table but at the same time makes the 'awake' go down to 0 in 'players' table. also if the player doesnt have 10000 gold then it says a error message. can anyone tell me the code snippets needed for this? Quote Link to comment Share on other sites More sharing options...
F1Fan Posted September 18, 2008 Share Posted September 18, 2008 $query = "SELECT gold FROM players WHERE player_id = $id" ----- add your db stuff here ----- if ($gold<10000) echo "Not enough gold..."; else{ $updatequery = "UPDATE players SET gold = (gold-10000), maxawake = 210, awake = 0 WHERE player_id = $id"; -- run your query and stuff } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.