-1
工作,这是我的控制器文件,它不工作 控制器名博客 型号名称blogmodel 视图文件名的loggedIn分页不要在我笨
function getvalues(){
$config['base_url'] = 'http://192.168.1.50/codeigni/index.php/blog/getvalues';
$config['total_rows'] = 200;
$config['per_page'] = 20;
$this->pagination->initialize($config);
echo $this->pagination->create_links();
$this->load->model('blogmodel');
$data['results']=$this->blogmodel->getall();
$this->load->view('Login/loggedin',$data);
}
}
这是我的模型文件和模型名称“blogmodel”
function getall(){
$query=$this->db->query("SELECT * FROM user_details");
return $query->result();
}
}
这是我的视图文件无法访问分页
<p><?php echo $links; ?></p><?php
echo "<table border='1'>
<tr>
<th>id</th>
<th>username</th>
<th>password</th>
<th>email</th>
</tr>";
foreach($results as $row){
echo "<tr>";
echo "<td>" .$row->id;
echo "<td>". $row->username;
echo "<td>". $row->password;
echo "<td>". $row->email;
echo "</tr>";
}
echo "</table>";
?>
然后解决它的。如果我们不知道为什么'它不工作',我们该如何帮助。你需要详细说明一下。 – Ryan
其固定它提供错误名称 – user3172683
消息:未定义变量:链接 文件名:登录/ loggedin.php – user3172683