I wrote a simple while loop:
while($fetch = $stm->fetchAll()) {
echo '<tr class=""'>;
echo '<td>' . $fetch['name'] . '</td>';
echo '</tr>';
}
How can I make the class="" alternate everytime so that every other row is white and every other row is grey? I already have the CSS class "greyRow" but don't know how to logically use it to make them alternate in PHP.
I'd assume I'd need a for loop, but how do I use it for what I'm trying to do?
Thanks.