Im trying to make so that when people train they gain more stats per a train
$tgain=0;
for($i=1;$i<=$_GET['times'] && $ir['energy'] > 0;$i++)
{
if ($ir['energy'] > 0)
{
$gain=rand(1,4)/rand(600,705)*rand(600,705)*($ir['will']+20/150);
$tgain+=$gain;
if ($_GET['train']=="IQ") { $gain/=100; }
$ir[$_GET['train']]+=$gain;
$egain=$gain/100;
$ts=$ir[$_GET['train']];
$st=$_GET['train'];
mysql_query("UPDATE userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or die("UPDATE userstats SET $st=$st+$gain,energy=energy-1,exp=exp+$egain WHERE userid=$userid
".mysql_error());
$wu=(int) (rand(1,3));
if ($ir['will'] >= $wu)
i was told that this line is where to up the stats
$gain=rand(1,4)/rand(600,705)*rand(600,705)*($ir['will']+20/150);
But stats where about the same can anyone please help thanks