I am trying to get all ODD rows to colour different than the EVEN rows so it's is easier to read if you got a lot of outputs.
The script is working, well, almost. I don't get any errors, but when the script did find results, it will show everything except the results itself. So the 'results field' will be kept empty.
Can somebody help me with the problem? Or give me a hint where to look?
$res=mysql_db_query("$db","SELECT Type FROM Vluchten WHERE Vertrek='$van' AND Aankomst='$naar';",$dbh);
$aantal_lijnen=mysql_num_rows($res);
if($aantal_lijnen > 0)
{
echo "<center><b>$van</b> - <b>$naar</b></center><br>";
echo "
<TABLE BORDER=\"1\" cellspacing=1 CELLPADDING=0 bgcolor=\"red\">
<tr>
<td width=100>
<TABLE BORDER=\"0\" cellspacing=\"0\" CELLPADDING=3 bgcolor=\"white\">
<td>
<b>Type</b>
</td>
</tr>";
for($i = 0; $i < $limit; $i++){
for ($count = 1; $row = mysql_fetch_array($res);++$count)
{
if ($count & 1)
{
$color = "#FFFFFF";
$font = "black";
} else
{
$color = "#CCCCCC";
$font = "black";
}
echo "
<TR>
<td bgcolor=\"$color\"><font color=\"$font\">$row[Type]</font></td>
</TR>";
}
echo "
</TABLE>
</td></tr></table>";
}
}
else
{
echo "No results <b>$van</b> to <b>$naar</b><br><br>";
echo "<a href=\"$PHP_SELF\">Search again</a>";
}
}