原代码如下:  $catsql="select * from nov_cat order by id";
  $catres=@mysql_query($catsql);

  for ($i=0;$i<@mysql_num_rows($catres);) {
    $catle.="<table width=\"960\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
    $catle.="<tr>\n";
    <1>for ($k=0;$k<3;$k++) {
      if ($i>=@mysql_num_rows($catres)){break;}
        $booksql="select * from nov_books where catid=".@mysql_result($catres,$i,"id")." order by id desc";
        $bookres=@mysql_query($booksql);        //if (@mysql_num_rows($bookres)==0)continue;
        请这个地方,我怎么也不行啊!
    说明:当@mysql_num_rows($bookres)等于"0"的时候就跳过<1>本次循环,进入<1>的下一个循环中

        $catle.="<!--".@mysql_result($catres,$i,"tittle")."分类开始-->\n";
        $catle.="<td width=\"320\">\n";
        $catle.="<table width=\"99%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"main\">\n";
        $catle.="<tr>\n";
        $catle.="<td>\n";
        $catle.="<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
        $catle.="<tr>\n";
        $catle.="<td class=\"title1\" colspan=\"2\">".@mysql_result($catres,$i,"tittle")."</td>\n";
        $catle.="</td>\n";
        $catle.="</tr>\n";
        $catle.="<tr>\n";
        $catle.="<td width=\"100\" height=\"125\" rowspan=\"2\" class=\"titletu\">";
        $catle.="<img width=\"100\" height=\"125\" src=".@mysql_result($bookres,0,"images").">";
        $catle.="</td>\n";
        $catle.="<td class=\"title5\">&nbsp;《".@mysql_result($bookres,0,"tittle")."》</td>\n";
        $catle.="</tr>\n";
        $catle.="<tr>\n";
        $catle.="<td height=\"103\" class=\"title11\">";
        if (strlen(@mysql_result($bookres,0,"description"))>260) {
          $catle.=substr(@mysql_result($bookres,0,"description"),0,250);
        }else{
          $catle.=@mysql_result($bookres,0,"description");
        }
        $catle.="...</td>\n";
        $catle.="</tr>\n";
        $catle.="</table>\n";
        $catle.="</td>\n";
        $catle.="</tr>\n";
        for ($b=1;$b<11;$b++) {
         if ($b>=@mysql_num_rows($bookres)){break;}
            $catle.="<tr>\n";
            $catle.="<td>《".@mysql_result($bookres,$b,"tittle")."》</td>\n";
            $catle.="</tr>\n";
}
        $catle.="</table>\n";
        $catle.="</td>\n";
        $catle.="<!--".@mysql_result($catres,$i,"tittle")."分类结束-->\n\n";
        $i++;
        }
        $catle.="</tr>\n";
        $catle.="</table>\n";
        $catle.="<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
        $catle.="<tr>\n";
        $catle.="<td height=5>\n";
        $catle.="</td>\n";
        $catle.="</tr>\n";
        $catle.="</table>\n";
        }
echo $catle;