netpants Posted February 6, 2007 Share Posted February 6, 2007 I am using crons to add + somthing to a table in the database everyone hour how would I add a percentage instead of just a whole number, like how would I add 10% of the value of the uMiners table to uMiners based on the example below. $db->query("UPDATE users SET uGold=uGold+(uMineLevel*(1000*uMiners))"); Link to comment https://forums.phpfreaks.com/topic/37324-adding-a-percentage-of-a-table-value-to-the-table/ Share on other sites More sharing options...
netpants Posted February 6, 2007 Author Share Posted February 6, 2007 Can I use $db->query("UPDATE users SET uGold=uGold-10%"); ?? Link to comment https://forums.phpfreaks.com/topic/37324-adding-a-percentage-of-a-table-value-to-the-table/#findComment-178448 Share on other sites More sharing options...
Balmung-San Posted February 6, 2007 Share Posted February 6, 2007 Before you make another topic, please read this. Give people time. Also: $db->query("UPDATE users SET uGold=(uGold * 1.10)"); should work. Link to comment https://forums.phpfreaks.com/topic/37324-adding-a-percentage-of-a-table-value-to-the-table/#findComment-178454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.