本来我的网页里有4个div,里面有些表格什么的
然后把后缀从html改成php就显示不出来了
然后开始减小div个数,减到了1个
网上查了一下在头部加了error_reporting(E_ALL);
ini_set("display_errors","On");然后这1个div就显示出来了
我就把这个div再复制了一个,重新打开不光第2个没有显示出来,第一个里面的内容也减少了orz
求教为什么……之前也遇到过类似的问题,查询数据库里的记录放在一个表格里,如果有四五条记录,就可以显示出来,如果有十几条数据就显示不出来了

解决方案 »

  1.   


    就大概是<!DOCTYPE html>
    <html>
      
      <head>
        <meta cha这种样子,显示不完全
      

  2.   

    <!DOCTYPE html>
    <html lang="en">
    <?php
    error_reporting(E_ALL || ~E_NOTICE);
    ini_set("display_errors", "On");
    require_once "../connect.php";
    $conn = connectDB();
    if (!empty($_GET['searchinfo'])) {
        $searchinfo = $_GET['searchinfo'];
    }echo $searchinfo;
    ?><head>
        <meta charset="UTF-8">
        <title>Search result</title>
        <style type="text/css">
            body {
                background: #dddddd;
                margin: 0;
            }        #header {
                width: 80%;
                float: left;
                height: 60px;
                padding-top: 2.5%;
                padding-left: 5%;
            }        .headerimage {
                color: #3a2f70;
                margin: 1%;
                text-decoration: none;
            }        .strip {
                width: 100%;
                position: relative;
                z-index: 1;
                top: 25px;
            }        .rectangle {
                position: relative;
                z-index: 2;
                left: 70%;
                top: -20px;
            }        #search1 {
                width: 100%;
                margin: 0 auto;
                text-align: center;
                padding-top: 10px;        }        #search1 #input {
                position: relative;
            }        #search1 .s_ipt {
                width: 250px;
                padding: 10px 50px 10px 7px;
                border-radius: 5px;
            }        #search1 #select {
                width: 150px;
                padding: 10px 50px 10px 7px;
                color: #a9a9a0;
                border-radius: 5px;
                margin: 0 auto;
            }        #search1 .s_btn {
                width: 100px;
                height: 40px;
                cursor: pointer;
                font-size: 16px;
                background-color: #483f80;
                border: none;
                color: white;
                border-radius: 5px;
            }        .sbox input {
                width: 40%;
                height: 20%;
                /*background: url(../Library/images/bg.png) no-repeat;*/
                margin-left: 25%;
                border: none;
                float: left;
            }
            /*分页*/
            #goto {
                background-color: #483f80;
                font-size: 13pt;
                font-family: "Adobe 宋体 Std L";
                color: white;
                border: none;
                border-radius: 5px;
                width: 90px;
                height: 28px;
            }        #footer {
                background: #3a2f70;
                width: 1687px;
                float: left;
                padding: 10px;
                height: 30px;
                position: absolute;
                bottom: 0;
            }
        </style>
    </head>
    <body id="bg">
    <!--header-->
    <div id="header">
        <a class="headerimage" href="Home.php">
            <img src="../images/Home_blue.png" alt="Home">
            <b>Home</b>
        </a>
        <a class="headerimage" href="Center.html">
            <img src="../images/Center_blue.png" alt="Center">
            <b>Center</b>
        </a>
        <a class="headerimage" href="../login/logOut.php">
            <img src="../images/logout_blue.png" alt="Log out">
            <b>Log out</b>
        </a>
    </div><!--Strip Decoration-->
    <div class="blue">
        <img src="../images/thinblue.png" class="strip">
        <img src="../images/recResult.png" class="rectangle">
    </div><form action="reader_search2.php" method="post">
        <div id="search1">
                <span id="input"><input type="text" class="s_ipt" maxlength="100" id="searchinfo" name="searchinfo"
                                        style="border: none" placeholder="Please input the keyword"
                                        value="<?php $search ?>"></span>
            <select id="select" name="select" style="border: none">
                <option value="book_name" selected="selected">By Title</option>
                <option value="book_author">By Author</option>
                <option value="book_pub_name">By Pub House</option>
            </select>
            <input type="submit" value="Search" class="s_btn" style="border: none">
        </div>
    </form><?php
    $searchinfo = $_POST['searchinfo'];
    //echo $searchinfo, '<br>';
    if (isset($_POST['select'])) {
        $selecttype = $_POST['select'];
    } else {
        $selecttype = 'book_name';
    }
    //echo $selecttype, '<br>';$cond = "SELECT *, COUNT(book_id) AS book_num FROM book_info WHERE book_id <> 0";
    if ($_POST['searchinfo']) {
        $cond .= " AND $selecttype LIKE '%$searchinfo%'";
    }$cond .= " GROUP BY book_isbn";
    //分页
    $cond .= " LIMIT 0,3";
    //echo $cond;$result = mysqli_query($conn, $cond);while ($result_arr = mysqli_fetch_assoc($result)) {
        $ID = $result_arr['book_id'];
        $BookName = $result_arr['book_name'];
        $Author = $result_arr['book_author'];
        $ISBN = $result_arr['book_isbn'];
        $PubHouse = $result_arr['book_pub_name'];
        $EditionYear = $result_arr['book_pub_date'];
        $BookNum = $result_arr['book_num'];
        $BookKind = $result_arr['book_kind_no'];
        $Location = $result_arr['book_call_no'];
        $Description = $result_arr['book_description'];
        $Tag = $result_arr['book_tag'];//    echo $ID, $BookName, $Author, $ISBN, $PubHouse, $EditionYear, $BookNum, $BookKind, $Location, $Description, $Tag, '<br>';    echo "
        <table align='center' width='70%' style='border-bottom: dashed; border-bottom-color: darkgray;'>
            <tr>
                <td rowspan='5' width='200px'><img src='../images/'></td>
                <td colspan='5'><b>$BookName</b></td>
                <td rowspan='5'><button style='background: #3a2f70; border: none; border-radius: 5px; color: white; font-size: 16px; padding: 10px;'>Borrow</button></td>
            </tr>
            <tr>
                <td width='200px'>Author:</td>
                <td width='200px'>$Author</td>
                <td width='200px'>Location:</td>
                <td width='200px'>$Location</td>
            </tr>
            <tr>
                <td>Pub House:</td>
                <td>$PubHouse</td>
                <td>Remain Num:</td>
                <td>$BookNum</td>
            </tr>
            <tr>
                <td>Year:</td>
                <td>$EditionYear</td>
                <td>Tag:</td>
                <td>$Tag</td>        </tr>
            <tr>
                <td>Book Num:</td>
                <td>$BookNum</td>
                <td></td>
                <td></td>
            </tr>
            </br>
    ";
    }$result->close();
    $conn->close();?>
    </table><div id="page" align="center">
        <form action="/" method="get" style="font-size: 13pt; color: darkgray">
            <a style="font-size: 13pt; color: black">Home&nbsp&nbsp</a>
            <a style="font-size: 13pt; color: black">Previous page&nbsp&nbsp</a>
            <a style="font-size: 13pt; color: black">Next page&nbsp&nbsp</a>
            <input type="number" maxlength="5" value="1">
            <input id="goto" type="button" value="Go to"/>
        </form>
    </div><!--common footer-->
    <div id="footer">
        <iframe align="left" width="100%" height="100%" src="../footer.html" frameborder="no" marginwidth="0"
                marginheight="0" scrolling="no"></iframe>
    </div></body>
    </html>
    200行左右那里的表格,如果我把174行limit 0,3改成limit 0,5,整个页面就都显示不出来了
    查看网页源代码就只显示了我整个代码的一部分<!DOCTYPE html>
    <html lang="en"><head>
        <meta charset="UTF-8">
        <title>Search result</title>
        <style type="text/css">
            body {
                background: #dddddd;
                margin: 0;
            }        #header {
                width: 80%;
                float: left;
                height: 60px;
                padding-top: 2.5%;
                padding-left: 5%;
            }        .headerimage {
                color: #3a2f70;
                margin: 1%;
                text-decoration: none;
            }        .strip {
                width: 100%;
                position: relative;
                z-index: 1;
                top: 25px;
            }        .rectangle {
                position: relative;
                z-index: 2;
                left: 70%;
                top: -20px;
            }        #search1 {
                width: 100%;
                margin: 0 auto;
                text-align: center;
                padding-top: 10px;        }        #search1 #input {
                position: relative;
            }        #search1 .s_ipt {
                width: 250px;
                padding: 10px 50px 10px 7px;
                border-radius: 5px;
            }        #search1 #select {
                width: 150px;
                padding: 10px 50px 10px 7px;
                color: #a9a9a0;
                border-radius: 5px;
                margin: 0 auto;
            }        #search1 .s_btn {
                width: 100px;
                height: 40px;
                cursor: pointer;
                font-size: 16px;
                background-color: #483f80;
                border: none;
                color: white;
                borde
    把显示的行数改少一点就可以显示出来了
      

  3.   

    代码在4楼基本上出问题解决方法就是每次读的数据的条数越来越少了求解决啊orz现在只能显示一条了我只不过加了一个搜索框而已网页限制显示内容的大小可以理解,但这个也太过分了吧Chrome……
      

  4.   

    把<table align='center' width='70%' style='border-bottom: dashed; border-bottom-color: darkgray;'>放到循环外面去
      

  5.   


    试了一下,还是不行呀
    我用到的图片都已经存成web所用格式压缩过了
    刚换完之后那段时间是可以显示多一点数据了,可是过了一天又不行了orz我记得我什么也没改