Does anyone know how I would make each row of the result a different color:
here is what I have:
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFF F" text="#000000">
<?
$connection=mys ql_connect("loc alhost", "bla bla", "bla bla") or die
("could not connect");
mysql_select_db ("yorkbia2_dbna me");
$result = mysql_query("SE LECT * FROM Board");
echo "<table border=0, table width=200%, bgcolor=#FFFFFF >\n";
while ($myrow = mysql_fetch_row ($result)) {
printf("<tr><td %s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>
<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</tr>\n",
$myrow[0], $myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5],
$myrow[6], $myrow[7], $myrow[8], $myrow[9], $myrow[10]);
}
echo "</table>\n";
?>
</body>
</html>
here is what I have:
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFF F" text="#000000">
<?
$connection=mys ql_connect("loc alhost", "bla bla", "bla bla") or die
("could not connect");
mysql_select_db ("yorkbia2_dbna me");
$result = mysql_query("SE LECT * FROM Board");
echo "<table border=0, table width=200%, bgcolor=#FFFFFF >\n";
while ($myrow = mysql_fetch_row ($result)) {
printf("<tr><td %s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>
<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</tr>\n",
$myrow[0], $myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5],
$myrow[6], $myrow[7], $myrow[8], $myrow[9], $myrow[10]);
}
echo "</table>\n";
?>
</body>
</html>
Comment