Yes, I have ANOTHER among the oh so many posts regarding this topic...
I've searched forums all over and FINALLY found a way that seems to ALMOST work for me.
Of course...I have a table. Within the table I have three columns
One row per column.
My Code
Above my While Statement I have
$color1 = "#FFFFFF";
$color2 = "#E3D9CA";
$row_count = 0;
Within my While Code I have
while ($emp = $result->fetch_assoc())
{
$fullname = $emp['first_name']." ".$emp['last_name'];
$row_color = ($row_count % 2) ? $color1 : $color2;
// Start Display
echo '</tr><tr>';
echo '<td width="275" bgcolor=$row_color nowrap>' . $fullname . '</td>';
echo '<td width="275" bgcolor=$row_color nowrap>' . $emp['title'] . '</td>';
echo '<td width="275" bgcolor=$row_color norwrap>' . $emp['ext'] . '</td>';
// VCard has been uploaded
if ($emp['vcard'])
{
echo "<td width='100' bgcolor=$row_color nowrap><a href='{$emp['vcard']}' target='_blank'><img src='../images/vcard.gif'</a></td>";
}
$row_count++;
}
echo '</tr></table>';
Now, when I display in the browser the first three columns all show up black (even though that's not one of the two alternating colors. That 4th row within that IF statement comes out exactly what I was lookin' for. In the words of Jerry Seinfield "What's Up With THAT?".
Sorry I placed the code right in the post, wasn't sure how to get in those blocks that ppl seem to use in many posts