Menu
How can I make every other row a different color, while pulling data from a database. The code is below:
[code=php]
mysql_select_db(“email_request”, $con);$result = mysql_query(“SELECT * FROM Email ORDER BY Date DESC”);
echo “<table class=’sortable’>
<tr>
<th>Name</th>
<th>Email</th>
<th>Date</th>
</tr>”;
while($row = mysql_fetch_array($result))
{
echo “<tr>”;
echo “<td>” . $row[‘Name’] . “</td>”;
echo “<td>” . $row[‘Email’] . “</td>”;
echo “<td>” . $row[‘Date’] . “</td>”;
echo “</tr>”;
}
echo “</table>”;
I have been allover different forums trying to figure out an easy way to do this. Any help would be much appreciated.