The preferred method to check if a row is odd or even is to use the modulus (%😉 of a number when divided by 2:
$color = ($i%2) ? $color_one : $color_two;
Also, it's typical to set a class rather than use the bgcolor attribute, which is deprecated and results in a lot of extra code. Note also that you only need to set the class for the odd rows, because if you set a default for all the rows, just changing the odd rows gives you the alternate colour effect.
Lastly, you can do away with all this with a small bit of CSS code:
td {background-color: #fff;}
tr:nth-child(even) td {background-color: #bbcced;}