Hi I am trying to get some date from a database and place it on a web page...
The problem I am having is to get PHP to alternate the colors for each line - say light blue, then white, then light blue, then whist again and again, till the end of the list.
here is teh code I have so far:
Thnx,
Charlie
<?PHP
// Displays info about the number of rows
// found in the database matching the
// search
print "The query: '$query' returned $num_of_rows rows of
data.";
// Displays the table headers
print "
<p>
<table width=715 border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<th nowrap>Account ID</th>
<th nowrap>Name</th>
<th nowrap>Address</th>
<th nowrap>Town</th>
<th nowrap>State</th>
<th nowrap>Zip</th>
<th nowrap>Country</th>
<th nowrap>Email</th>
<th nowrap>Phone Number</th>
<th nowrap>Signup Date</th>
</tr>
";
// LOOP - Loops until all rows found in
// the database matching the search are
// displayed.
while ($row = mysql_fetch_row ($query_result_handle))
{
print "
<tr>
<td nowrap><b> $row[1] </b></td>
<td nowrap> $row[2] </td>
<td nowrap> $row[3] </td>
<td nowrap> $row[4] </td>
<td nowrap> $row[5] </td>
<td nowrap> $row[6] </td>
<td nowrap> $row[7] </td>
<td nowrap> $row[8] </td>
<td nowrap> $row[9] </td>
<td nowrap> $row[10] </td>
</tr>
";
}
// Closes (Ends) the table tag
print "
</table>
";
?>