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)'); ?> Link to comment https://forums.phpfreaks.com/topic/41050-one-not-working/ 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 Link to comment https://forums.phpfreaks.com/topic/41050-one-not-working/#findComment-198815 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? Link to comment https://forums.phpfreaks.com/topic/41050-one-not-working/#findComment-198816 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. Link to comment https://forums.phpfreaks.com/topic/41050-one-not-working/#findComment-198817 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() Link to comment https://forums.phpfreaks.com/topic/41050-one-not-working/#findComment-198821 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.