I have a small problems and hope someone can help me...I need to have 2 different row-colors in my forum. heres the code:
<?php
//Writes from the database
$connection = mysql_connect ("localhost", "root" , "") or die ("Oppkobling mislyktes");
mysql_select_db ("FORUM") or die ("Database eksisterer ikke");
$sql = "SELECT * FROM kategorinavn";
$result = mysql_query ($sql);
while ($line = mysql_fetch_array ($result, MYSQL_ASSOC)) {
print "<tr>";
print "<td class=\"td3\"><img src=\"gif/lilla2.gif\" alt=\"\" border=\"0\"></td>";
print "<td>"?><strong><a href ="bruker_innlegg.php?kategoriid=<?php print $line["kategoriid"];?>"><?php print $line ["kategorinavn"] . "</a></strong><br />";?><?php print $line["kategori_info"] . "</td>";
print "<td>" . "</td>";
print "<td>" . "</td>";
$sql2 = "SELECT dato from innlegg WHERE kategoriid = " . $line["kategoriid"] . " ORDER BY dato DESC LIMIT 0,1";
$result2 = mysql_query($sql2);
while($line2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
print "<td class=td3>" . $line2["dato"] . "</td>";
}
print "</tr>";
}
?>
Can someone put the code for 2 different row-colors in the code above??