Any help please!!! Here is the short code, it is pulling the data from MySQL just fine, but the row color isn't alternating. Help PLEASE. Kind of new to the whole PHP MySQL world.
<?php
$connection = mysql_connect ("localhost", "root", "");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
exit;
}
$query = "select * from anvils";
$result = mysql_db_query ("monetta_farrier_db", $query);
if ($result){
echo "<table width=415 border=0 cellspacing=2 cellpadding=2 align=left>";
$numOfRows = mysql_num_rows ($result);
for ($i = 0; $i < $numOfRows; $i++){
$row_color = ($row_count % 2) ? $color_one : $color_two;
$color_one = "EEEECC";
$color_two = "EEEECC";
$row_count = 0;
$part_number = mysql_result ($result, $i, "Part Number");
$description = mysql_result ($result, $i, "Description");
$price = mysql_result ($result, $i, "Price");
echo "<tr bgcolor=$row_color>
<td width=115>
<p align=left style='font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 8pt; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt;'>
$part_number
</p>
</td>
<td width=255>
<p align=left style='font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 8pt; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt;'>
$description
</p>
</td>
<td width=50>
<p align=left style='font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 8pt; margin-bottom: 0pt; margin-left: 4pt; margin-right: 0pt; margin-top: 0pt;'>
$price
</p>
</td>
</tr>";
$row_count ++;
}
echo "</table>";
}
else{
echo mysql_errno().": ".mysql_error()."<BR>";
}
mysql_close ();
?>
Thanks
CravoZ71