Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
数据库中的PHP表格仅显示61个条目?_Php_Sql_Database_Html Table - Fatal编程技术网

数据库中的PHP表格仅显示61个条目?

数据库中的PHP表格仅显示61个条目?,php,sql,database,html-table,Php,Sql,Database,Html Table,如果要显示一个包含150多个条目且只有61个条目显示的表,我如何使所有条目在页面上无限期显示,或添加“页面”功能,以便我们可以浏览所有条目,而不仅仅是其中的61个 <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Posting Info</h1> </div> &

如果要显示一个包含150多个条目且只有61个条目显示的表,我如何使所有条目在页面上无限期显示,或添加“页面”功能,以便我们可以浏览所有条目,而不仅仅是其中的61个

<div id="page-wrapper">
<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">Posting Info</h1>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                Post Info Table
            </div>
            <div class="panel-body">
                <div class="row-sm-4">
                    <div class="col-lg-6" style="width: 100% !important;">
                        <form role="form" style="width: 100% !important;">
                              <div class="table-responsive" style="width: 100% !important;">
                                 <table class="table table-bordered table-striped" style="width: 100% !important;">
                                     <thead>
                                         <tr>
                                             <th>Example1</th>
                                             <th>Example2</th>
                                             <th>Example3</th>
                                             <th>Example4</th>
                                             <th>Example5</th>
                                             <th>Example6</th>
                                             <th>Example7</th>
                                             <th>Example8</th>
                                         </tr>
                                     </thead>
                                     <tbody>
                                           <?php
                                                $postList = '';
                                                $q = $db->prepare("SELECT * FROM `examples`");
                                                $q->execute();
                                                $q = $q->fetchAll();

                                                foreach ($q as $post)
                                                {
                                                      $postList .= '<tr> <td>'.$post['exmpl1'].'</td>
                                                                                  <td>'.$post['exmpl2'].'</td>
                                                                                  <td>'.$post['exmpl3'].'</td>
                                                                                  <td><a href="../'.$post['exmpl4'].'">Click to View</a></td>
                                                                                  <td>'.$post['exmpl5'].'</td>
                                                                                  <td>'.$post['exmpl6'].'</td>
                                                                                  <td>'.$post['exmpl7'].'</td>
                                                                                  <td>'.$post['exmpl8'].'</td>
                                                      </tr>';
                                                }

                                                print $postList;
                                          ?>
                                     </tbody>
                                 </table>
                             </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

发布信息
邮政信息表
例1
例2
例3
例4
例5
例6
例7
例8

当前仅显示多达61个条目,但条目中的所有信息均正确显示。代码是有效的,但似乎是有限的。我正在寻找一种方法来消除此限制。

您的代码看起来不错,它应该显示所有匹配的行

您应该使用
echo'There are'来调试它$q->rowCount()找到了行',这将输出找到的行数


至于页面功能,它被称为a,您应该查看如何创建一个。

在select查询中添加
LIMIT 200

$q=mysql\U查询(“select*from students LIMIT 61”)

$num\u row=mysql\u num\u row($q)


您可以这样使用

将更多记录添加到示例表:)数据库中有137条记录,但只有61条记录被放入此表中。这就是问题所在:(查找数组$q的长度,这样您就可以通过查询找到返回的确切值。现在,它在表中显示了35个条目。非常混乱?我不希望它只显示61,它只显示61,不再显示更多。我正试图允许它显示所有的entries。听起来可能很愚蠢,但我应该将回声测试字符串放在哪里?我已经将它放在服务器上了。)所有位置,但它什么也不做:/Insert之后,将其放置在该位置,但它也没有做任何操作,必须将其更改为“打印”而不是“回音”,您没有收到任何错误吗?这里不需要打印/回音。尝试将其更改为
,您应该会收到JavaScript警报。它显示“显示1行”然而,有61件正在展出