right well its using a table called user_training.
it has production_lvl, next_lvl and cost.
the defaults for them are 1,2,100.
that code there sets nproduction_lvl to 2. nnext_lvl to 3. it should then set cost to 2+(260)+(1002). which is 322. but all it does is adds 60, or 61. cant remember. its like neglecting the multiplicaiton.
nproduction_lvl and nnext_lvl work, those fields update.
EDIT noticed another prob.-
$new_user_gold=$user_gold-$cost;
echo"$new gold is $new_user_gold";
this $new_user_gold is used with another table to update the users gold after they used it to upgrade. it too gets set to 0. $user_gold=500. i checked this and it is set to that. $cost=100. i checked this too, it is set to that. but when i do the above, it dont work.
EDIT:
$new_user_gold is set to 0....
also above, when i had cost as $cost=$cost*2, it was set to 0. wasnt till i added that addition part in that it used other numbers.