Jump to content

simple addition/subtraction?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
asdpyro

asdpyro

    Newbie

  • Members
  • PipPip
  • 19 posts
What I want to do is make the output from this code be 200-"output" so that if the out put is 10 what is seen on page is 190.

$row = mysql_fetch_array($result) or die(mysql_error());


// Echo some results

echo $row[0];


#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
// Echo some results
echo (200-$row[0]);  

Or you can assign the output to a variable and substract:

// Echo some results
$output = $row[0];  
$subtractionValue = 200 - $output;
echo $subtractionValue;


#3
asdpyro

asdpyro

    Newbie

  • Members
  • PipPip
  • 19 posts
ah ok, that must be what i was doing wrong, php is new to me, thanks tho. Its been very helpfull knowing about this site