HI Guys,
Im tryiong to display fields from my database in a table with altenate coloured rows. can anyone help fix what i have so far
<html>
<head> </head>
<body>
<?php
$color[0] = "red";
$color[1] = "yellow";
mysql_connect("localhost","phpuser","phpuser03") or die ("Database connection error");
mysql_select_db('helpdesk');
$sql = "SELECT jobId, , room, computers,description, date FROM requests_table ;
$result = mysql_query($sql);
echo "<table>\n";
echo " <tr>\n";
echo " <th><b>JobID</b></th>\n";
echo " <th><b>Room</b></th>\n";
echo " <th><b>Computers</b></th>\n";
echo " <th><b>description</b></th>\n";
echo " </tr>\n";
while ($row = mysql_fetch_array($result)) {
$a = ($a+1)%2;
echo '<tr bgcolor='.$color[$a] . ">\n";
{
echo '<td><a href="tech.php?jobId='.$row['jobId'].'">' . $row['jobId'] . "</a></td>"; }
else {
echo '<td>'.$row['room'].'</td>';}
echo ' <td>'.$row['computers'].'</td>'."\n";
echo ' <td>'.$row['description'].'</td>'."\n";
?>
</body>
</html>