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"]."'"); ?> Link to comment https://forums.phpfreaks.com/topic/139282-solved-adding-to-mysql-depending-on-field-level/ 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. Link to comment https://forums.phpfreaks.com/topic/139282-solved-adding-to-mysql-depending-on-field-level/#findComment-728600 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.