PHP question on while query

Sifyise

New Member
Could someone help me figure out how to do this.I have a game where a player can use potions to enhance their abilities.This is on a timer which works fine. However Im now looking to add to this query when the player uses 2 different type of potions. I can get it to work but not 100% how I wish.Player uses potion 1 and their stats are boosted by 20% for 20minutes.Player then uses potion 2 and their stats are boosted by 60% for 20minutes.With my code at the moment\[code\]$check = sprintf("SELECT time,strmod FROM `effects` WHERE `userid` = %u", $userid);$exe = mysql_query($check);while($bonus = mysql_fetch_array($exe)){$last = $bonus['time'];$strmod=$bonus['strmod']);\[/code\]It will display the users bonus (base strength in this example is 2,364,195)Potion 1 boost your base strength to 2837034 (+20%)Potion 2 boost your base strength to 3782712 (+60%)Is there a solution where I can get the second 60% potion to take into account the bonus received from the 1st potion. So 60% of 2837034 rather than 2364195. Before I consider recoding the whole thing :DI hope thats clear bit hard to explain.Thanks
 
Back
Top