onyxblack Posted January 3, 2009 Share Posted January 3, 2009 ok... well, seems like theres a few of us on this forum that are working on making a text based game... Anywho.. my problem I want to be able to "add" to someones gold depending on their income level. I have a program that will run this page on a local folder every hour. The problem is - this script just dosn't work. I think it has to do with $getgold is returning more then 1 line and update gold is only attempting to update 1 line, though it dosn't appear to be effecting anything... I've gotten fairly far on my site, check it out http://bladefight.net <?php include('./../ix.conf.php'); mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS); mysql_select_db(MYSQL_DB); $getgold = mysql_query("select `account`, `gold`, `incomelevel` FROM player_army WHERE gold>1"); $fetchgold = mysql_fetch_array( $getgold ); $income = ($fetchgold["incomelevel"]*2); $addgold = $income+$fetchgold["gold"]; $Updategold = mysql_query("update `player_army` SET `gold`=$addgold WHERE (`account`='".$fetchgold["account"]."'"); ?> Quote Link to comment Share on other sites More sharing options...
onyxblack Posted January 3, 2009 Author Share Posted January 3, 2009 Took me a while... but i seemed to have got it. 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.