I just cant seem to figure this one out. Im trying to get mysql results to show up in a table with alternating rows. My code:
PHP Code:
function rowbg() {
static $j=1;
if ($j%2 != 0.5) {
echo "display_row1";
$j++;
} else {
echo "display_row2";
$j++; }
}
then i do:
PHP Code:
<tr class="<?php rowbg(); ?>">
to make it alternating. However it just returns the first case. Now where is my error?