[SOLVED] How to show evry other row in diferent color
Posted: Tue Jul 06, 2004 1:49 am
How to show evry other row in diferent color
colors should be:
#CCCC99 and #CCCCCC
colors should be:
#CCCC99 and #CCCCCC
Code: Select all
<?php
include("con_db.php");
$query_count2 = mysql_query("select city, mjesto, count(*) as 'broj_iznajmljivaca'
from apartmani
where Zupanija = '$zupanija_smjestaja' and vrsta_smjestaja='$vrsta' and kategorija='$kategorija'
group by city, mjesto
order by city ") or
die (mysql_error());
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
while ($result_row2 = mysql_fetch_assoc($query_count2)){
$totalrows2 = $result_row2['broj_iznajmljivaca'];
$grad = $result_row2["city"];
$mjesto = $result_row2["mjesto"];
echo "<table border = 1 table width="100%">";
if($vrsta=="apartman"){
echo "<td width="40%"align="left">" . $font . $grad . " (" . $mjesto. ")" . "</td><td width="20%"align="center">" . $font . '<a href="result_app.php?grad='.urlencode($grad).'&mjesto=' . urlencode($mjesto) .'&vrsta=' . urlencode($vrsta) .'">' . $totalrows2 . '</a>' . "</td>";}
if($vrsta=="soba"){
echo "<td width="40%"align="left">" . $font . $grad . " (" . $mjesto. ")" . "</td><td width="20%"align="center">" . $font . '<a href="result_soba.php?grad='.urlencode($grad).'&mjesto=' . urlencode($mjesto) .'&vrsta=' . urlencode($vrsta) .'">' . $totalrows2 . '</a>' . "</td>";}
if($vrsta=="agroturizam"){
echo "<td width="40%"align="left">" . $font . $grad . " (" . $mjesto. ")" . "</td><td width="20%"align="center">" . $font . '<a href="result_agroturizam.php?grad='.urlencode($grad).'&mjesto=' . urlencode($mjesto) .'&vrsta=' . urlencode($vrsta) .'">' . $totalrows2 . '</a>' . "</td>";}
echo "</table>";
}
mysql_free_result($query_count2);
mysql_close($conn);
<?php
?>