tony007
May 22nd, 2006, 06:49 AM
I am using this code to output the search result for song title and currently it uses same color for all maches.What i want to use this color #FFB951 and #C0C0C0
for background of each row but not same color for consucative rows . In another word if there are 4 records i want first one to be #C0C0C0 and second #FFB951 and 3th #C0C0C0 and 4th #FFB951 .Could any one tell me how this can be done.
$numbers=0;
while($row = mysql_fetch_assoc($result))
{
$numbers++; // counting number of records
?>
<?
switch ($m):
case "title": ?>
<tr>
<td bgcolor="#C0C0C0"><? echo $numbers; ?> </td>
<td bgcolor="#C0C0C0"><a
href="javascript:newWindow('./playlistfromdbtotextfile.php?songid=<?=strval( $row['id'] );?>')"><img
src="./images/Speaker.gif" alt="Listen to this Song"
border="0" width="16" height="16"
longdesc="Listen to this Song"></a> <b><?=strval( $row['songname'] );?></b> </td>
<td bgcolor="#C0C0C0"><a
href=" ./albumsongs.php?albumname=<?=strval( $row['album'] );?>&artistname=<?=strval( $row['artist'] );?>"><?=strval( $row['album'] );?></a>
</td>
<td bgcolor="#C0C0C0"><a
href="albums.php?albumname=<?=strval( $row['artist'] );?>"><?=strval( $row['artist'] );?></a> </td>
td bgcolor="#C0C0C0">66 </td>
</tr>
for background of each row but not same color for consucative rows . In another word if there are 4 records i want first one to be #C0C0C0 and second #FFB951 and 3th #C0C0C0 and 4th #FFB951 .Could any one tell me how this can be done.
$numbers=0;
while($row = mysql_fetch_assoc($result))
{
$numbers++; // counting number of records
?>
<?
switch ($m):
case "title": ?>
<tr>
<td bgcolor="#C0C0C0"><? echo $numbers; ?> </td>
<td bgcolor="#C0C0C0"><a
href="javascript:newWindow('./playlistfromdbtotextfile.php?songid=<?=strval( $row['id'] );?>')"><img
src="./images/Speaker.gif" alt="Listen to this Song"
border="0" width="16" height="16"
longdesc="Listen to this Song"></a> <b><?=strval( $row['songname'] );?></b> </td>
<td bgcolor="#C0C0C0"><a
href=" ./albumsongs.php?albumname=<?=strval( $row['album'] );?>&artistname=<?=strval( $row['artist'] );?>"><?=strval( $row['album'] );?></a>
</td>
<td bgcolor="#C0C0C0"><a
href="albums.php?albumname=<?=strval( $row['artist'] );?>"><?=strval( $row['artist'] );?></a> </td>
td bgcolor="#C0C0C0">66 </td>
</tr>