I pull 2 variables out of the db and then I put them into variables.
Lets say they are $var[1] and var[2] and $var[1] = 18 and $var[2]= 5. Now then I go
$cost = $var[1] - $var[2];
and instead of the answer being 13 it is 0, why does it do that.
Are you sure of those values? Also, just as a rule of thumb, I usually add parentheses around my math.
$cost = ($var[1] - $var[2]);
my bad, it was something to do with the query codes
Its a good idea to also do what LordShryku said.. especially when outputting them like this
echo $var-$var2;