this is the error message i keep getting...i can't figure out what i'm missing...jv
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/radishbe/public_html/newsloop5a.php on line 9
<?
$ond = $row["onderwerp"];
$sql = "SELECT * FROM comments WHERE cnewsid = $nid ORDER BY cdate DESC";
$res = mysql_query($sql); <----------THIS IS LINE 9
if(mysql_num_rows($res) == 0){
echo "<tr bgcolor=\"FFFFFF\">\n";
echo "<td valign=top align=left class=\"NormalText\">\n";
echo "No reply's\n";
echo "</tr>\n";
} else {
while($row = mysql_fetch_object($res)){
echo "<tr bgcolor=\"FFFFFF\">\n";
echo "<td valign=top align=left class=\"NormalText\">\n";
echo "<b>Subject:</b> ".htmlspecialchars($row->onderwerp)."<br>\n";
echo "<b>By:</b> ".htmlspecialchars($row->cauthor)."<br>\n";
echo "<b>Written on:</b> $row->cdate<br>\n";
echo "<b>Message:</b><br> ".MaakOp($row->cmessage)."</td>\n";
echo "</tr>\n";
}
}
?>