Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.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 分页,不显示下一页_Php_Codeigniter_Pagination_Segment - Fatal编程技术网

Php 分页,不显示下一页

Php 分页,不显示下一页,php,codeigniter,pagination,segment,Php,Codeigniter,Pagination,Segment,解决了 如果我点击第2页,那就是错误: 找不到 在此服务器上找不到请求的URL/rank/GetAll/30 我的链接是: http://localhost/rank/GetAll/30 模型:秩和模型 <?php Class Rank_Model extends CI_Model { public function __construct() { parent::__construct(); } public function record_count() {

解决了

如果我点击第2页,那就是错误:

找不到 在此服务器上找不到请求的URL/rank/GetAll/30

我的链接是:

http://localhost/rank/GetAll/30
模型:秩和模型

<?php
 Class Rank_Model extends CI_Model {

  public function __construct() {
   parent::__construct();
  }

  public function record_count() {
   return $this->db->count_all("ranking");
  }

  public function fifa_rank($limit, $start) {
   $this->db->limit($limit, $start);
   $query = $this->db->get("ranking");

   if ($query->num_rows() > 0) {
        foreach ($query->result() as $row) {
          $data[] = $row;
        }
        return $data;
      }
      return false;
   }
 }

 ?>
但接下来:

http://localhost/rank/GetAll/30
在secend link中,我没有index.php。我怎样才能修好它

在$config[“base_url”]=base_url()中。“排名/得分”; 我补充说: $config[“基本url”]=基本url()。“index.php/rank/GetAll”

没关系:)

看这里
$data[“links”]=$this->pagination->create_links()
正如代码所说,您有一个链接数组

foreach( $data["links"] as $links)
    {?>
    <p><?php echo $links; ?></p>
    <?php }
foreach($data[“links”]作为$links)
{?>


尝试将默认值定义为$page=0以获取所有()并删除对$page=($this->uri->segment(3))?$this->uri->segment(3)的赋值:0;并在url中提供/after GetAll

第一页的url是什么样子的?您的重写规则是否有效,这样您就可以使用url而不必
index.php
?现在我知道我的问题出在哪里了。在第一页我有链接:但在下一页:在secend link中,我没有index.php。我如何修复它?尝试使用而不是
base_url
在控制器中的方法
GetAll
中。@marcin_poland-如果您已经解决了自己的问题,最好写一个新的答案,详细说明您的解决方案。不要忘记对任何有用的答案进行投票!
<table>
 <thead>
   <tr>
   <td>Pozycja</td>
   <td>Kraj</td>
   <td>Punkty</td>
   <td>Zmiana</td>
   </tr>
 </thead>

<?php
 foreach($results as $data) {?&gt;
  <tbody>
   <tr>
   <td><?php print $data->pozycja;?></td>
   <td><?php print $data->kraj;?></td>
   <td><?php print $data->punkty;?></td>
   <td><?php print $data->zmiana;?></td>
   </tr>
<?php } ?>

</tbody>
</table>

<p><?php echo $links; ?></p>
http://localhost/index.php/rank/GetAll
http://localhost/rank/GetAll/30
foreach( $data["links"] as $links)
    {?>
    <p><?php echo $links; ?></p>
    <?php }