grlayouts Posted March 3, 2007 Share Posted March 3, 2007 ok i now have the script. the only bit that is not updating is the wages part from the credits. <? include('config.php'); $wagebill = ($stat[employees]*$stat[wages]); error_reporting(E_ALL) ; ini_set('display_errors', 1); mysql_query('UPDATE players SET drugs = drugs + (drugfact*300), dpayout = (drugfact*300), steaks = steaks + (steakhouse*300), spayout = (steakhouse*300);'); mysql_query('UPDATE players SET credits=credits-($wagebill)'); ?> Quote Link to comment Share on other sites More sharing options...
LazyJones Posted March 3, 2007 Share Posted March 3, 2007 sure $wagebill is not 0 ? btw. all those parenthesis in your calculations are meaningless, considering basic arithmetics Quote Link to comment Share on other sites More sharing options...
coldkill Posted March 3, 2007 Share Posted March 3, 2007 is credits a variable or a constant value? Quote Link to comment Share on other sites More sharing options...
grlayouts Posted March 3, 2007 Author Share Posted March 3, 2007 yeah cos when i print wagebill its 6000 credits is a variable. in the database. Quote Link to comment Share on other sites More sharing options...
LazyJones Posted March 3, 2007 Share Posted March 3, 2007 variable in a database? you mean column name? maybe you should check the return value of mysql_query to see if it really fails, or just seems to fail and if it fails, check mysql_error() 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.