I would imagine u just read the variable from the row using an array and loop, then just do:
$tempvar = ($myrow["rating"] - 100);
something along those lines, I am worried about that code the person before me pasted.
Oh well, hope u manage to get it working!
ciao