我不知道为什么从phpMyAdmin
型号我CI
返回错误的值:`CI`返回错误值
<?php
class Post extends CI_Model
{
function __construct()
{
parent::__construct();
}
function getallpost()
{
return $this->db->get('post');
}
}
?>
而且
控制器:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Postc extends CI_Controller {
function index()
{
$this->load->model('post');
$posts=$this->post->getallpost();
echo '<pre>';
print_r($posts);
}
}
?>
这将工作。 – kishor10d
你走吧:)。另请阅读https://www.codeigniter.com/user_guide/general/views.html以获取标准惯例以创建视图 –