+ -
当前位置:首页 → 问答吧 → 各位高手帮我看看这个程式码哪里有问题

各位高手帮我看看这个程式码哪里有问题

时间:2011-08-02

来源:互联网

在PHP打程式码,对MySQL找资料库,表面上没有问题,但是在网页上执行资料跑不出来,请问哪里哪有问题?

<?php        
      
        include("function.php");
        linkdb();
        
        if( !isset($_COOKIE['id']) )
        {header("Location: index.php");        }
        else
        {$id=$_COOKIE['id'];}
        
        $pageRow_records = 5;
      
        $num_pages = 1;
        
        if (isset($_GET['page'])) {
          $num_pages = $_GET['page'];
        }
        
        $startRow_records = ($num_pages -1) * $pageRow_records;
        
        $sql_query1 = "SELECT * FROM `collection`
                where `collection_number`='$collection_number'";
      
        $sql_query_limit = $sql_query." LIMIT ".$startRow_records.", ".$pageRow_records;
        
        $result = mysql_query($sql_query_limit);
        
        $all_result = mysql_query($sql_query1);
        
        $total_records = mysql_num_rows($all_result);
        
        $total_pages = ceil($total_records/$pageRow_records);
        
?>

作者: sses61126   发布时间: 2011-08-02

在你的程式来看…并没有看到你有把资料输出到前端呀?

$total_pages是你要输出的吗??
要不要改用echo $total_pages; 试试

或者看一下log…看看这个页面是否有error

作者: cheaster   发布时间: 2011-08-03

热门下载

更多