Ok I'm pulling some rows from MySql, and I'm putting each row in a HTML table row. I basically want to alternate the rows' background colour, so row one will be for ex. blue, row two green, row three blue again, and so on...

I've set up variables for all the bgcolor tags, but what I can't figure out is how to toggle these variables between two value sets every time my while loop runs.

What I tried is:
Code:
	
if($toggle=1):
$toggle=2;
$dkcolour = "#669900";
$ltcolour = "#99FF00";
$hr = $hrclass[1];
				
elseif($toggle=2):
$toggle=1;
$dkcolour = "#006666";
$ltcolour = "#0099FF";
$hr = $hrclass[1];

endif;
It should be obvious why this doesn't work, the code checks for the toggle variable and toggles it, but then I'd need it to jump tp the next section and ignore the elseif statement (which just sets it back to 1)... I'm a newbie to programming in general so maybe there's a completely more intelligent way to do this....

Thx!