PHP question on while query
<p>Could someone help me figure out how to do this.</p>

<p>I have a game where a player can use potions to enhance their abilities.</p>

<p>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.</p>

<p>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.</p>

<p>With my code at the moment</p>

<pre><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></pre>

<p>It will display the users bonus (base strength in this example is 2,364,195)</p>

<p>Potion 1 boost your base strength to 2837034 (+20%)
Potion 2 boost your base strength to 3782712 (+60%)</p>

<p>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 :D</p>

<p>I hope thats clear bit hard to explain.</p>

<p>Thanks</p>
