我通过输出变量$allcou知道了检索是有结果的呀,可就是记录不显示出来.

解决方案 »

  1.   

    将显示的结果贴出来
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <?
    if ($linkdata)
    {
       mysql_select_db("test",$db);
       $onepage=5;
       $qstr_news="SELECT * FROM news";
       $allcou=mysql_num_rows(mysql_query("$qstr_news",$db));
       if ($pagestart>$allcou){$page=1;}
       $pagestart=($page-1)*$onepage;
       $allpage=ceil($allcou / $onepage);
       $qstr_news=$qstr_news." ORDER BY news_date DESC,news_id desc LIMIT   $pagestart,$onepage";
       echo "11111111".$db.'11111111<br>'; //&iquest;&acute;&Otilde;&acirc;&Ograve;&raquo;&frac34;&auml;&micro;&Auml;&frac12;á&sup1;&ucirc;&Ecirc;&Ccedil;&Ecirc;&sup2;&Atilde;&acute;
       $result_news = mysql_query("$qstr_news",$db)
    echo "222222".$db.'2222222222<br>'; //&iquest;&acute;&Otilde;&acirc;&Ograve;&raquo;&frac34;&auml;&micro;&Auml;&frac12;á&sup1;&ucirc;&Ecirc;&Ccedil;&Ecirc;&sup2;&Atilde;&acute;
       if (mysql_num_rows($result_news) > 0) 
         {
           $jishu_news=0;
           while($myrow_news=mysql_fetch_array($result_news))
          { 
           print"ok"; $news_id=$myrow_news["news_id"];
    $news_subject=$myrow_news["news_subject"];
    $news_content=$myrow_news["news_content"];
    $news_date=$myrow_news["news_date"];
    ?>
        <tr> 
           <td class="ak" height="18" width="2%" <? if($jishu_news % 2==0){echo "bgcolor=\"#F6F6F6\"";}?>>&nbsp;</td>
           <td class="ak" height="18" width="80%" <? if($jishu_news % 2==0){echo "bgcolor=\"#F6F6F6\"";}?>><font color="#990000">&pound;&laquo;</font> 
    <a href="shownews.php?news_id=<?echo $news_id;?>"  target="<? echo uniqid(rand());?>" class="a06"> 
    <?echo $news_subject;?></a><font color="#990000">&nbsp; 
    </font> </td>
    <td class="ak" width="18%" <? if($jishu_news % 2==0){echo "bgcolor=\"#F6F6F6\"";}?>><font color="#990000"><?echo $news_date;?></font></td>
         </tr>
    <?
         $jishu_news++;
           }
         }
         if($jishu_news<$onepage)
        {
           for($jishu_news;$jishu_news<$onepage;$jishu_news++)
            {
    ?>
     <tr> 
         <td class="ak" height="18" width="2%" <? if($jishu_news % 2==0){echo "bgcolor=\"#F6F6F6\"";}?>>&nbsp;</td>
         <td height="18" colspan="2" class="ak" <? if($jishu_news % 2==0){echo "bgcolor=\"#F6F6F6\"";}?>>&nbsp;</td>
     </tr>
    <?
            }
           }
     }?>
       </table>