hi everyone, just wondering if anyone can see right off the bat whats wrong with what i'm doing? I'm pretty much selecting info from the db and printing it...but i want to alternate the color of row for every entry...i created ".even" as a class in my css and linked to it...but whenever i use this code... i get this error:
Parse error: syntax error, unexpected T_PRINT in "url" on line 119
and line 119 is the first print statement...
when i remove:
$count =0;
$isEven = $count % 2
$count = $count +1;
if($isEven==0)
print("<tr class=\"even\">");
else
print("<tr>");
from the code, it works but only uses the initial color for the background...
<center>
<table border="0" cellpadding="4" cellspacing="4" bgcolor="#BABAA0" ><center>
<tr>
<td width="100"><b><font color="#022B54" face="Verdana" size="2">Reviewer</b></td>
<td width="10"><b><font color="#022B54" face="Verdana" size="2">Date</b></td>
<td width="450"><b><font color="#022B54" face="Verdana" size="2">Comment</b></td>
</tr>
<?
$dbh=mysql_connect ("localhost", "**", "") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("**");
?>
<?
//error message (not found message)begins
$XX = "No Record Found, to search again please close this window";
//query details table begins
$query = mysql_query("SELECT user, date, comment
FROM comments
ORDER BY date DESC");
$count =0;
while ($row = @mysql_fetch_array($query))
{
$variable1=$row["id"];
$variable2=$row["date"];
$variable3=$row["user"];
$variable4=$row["comment"];
//table layout for results
$isEven = $count % 2
print ("<tr>");
print ("<td>$variable3</td>");
print ("<td>$variable2</td>");
print ("<td>$variable4</td>");
print ("</tr>");
$count = $count +1;
if($isEven==0)
print("<tr class=\"even\">");
else
print("<tr>");