Sorry draw, I know you have already provided the answer, but I had to step in here for a moment, because I wonder if anyone bothers to STFF anymore.
Pick a Thread from this simple search or check out this stickied thread right here in the coding forum.
dcooper, for future reference, before posting questions do a few searches, because chances are, you'll find it's been asked and answered before. (several times) Anyhow, since I am here, may as well help out.
<?php
$light = '#00FF00'; //green
$dark = '#0000FF'; //blue
$color = $dark;
while ($data = mysql_fetch_array($result))
{
$color = ($color == $dark) ? $light : $dark;
echo '<tr><td bgcolor='.$color.'>'.$data['forename'].'</td><td bgcolor='.$color.'>'.$data['surname'].'</td><td bgcolor='.$color.'>'.$data['student'].'</td><td bgcolor='.$color.'>'.$data['sex'].'</td><td bgcolor='.$color.'>'.$data['form'].'</td><td bgcolor='.$color.'>'.$data['score'].'</td><td bgcolor='.$color.'>'.$data['band'].'</td></tr>';
}
[edit] Slight correction made. The $color=$dark needs to be outside of the loop.