Php Codeigniter编辑错误->;调用未定义的方法

Php Codeigniter编辑错误->;调用未定义的方法,php,codeigniter,frameworks,Php,Codeigniter,Frameworks,遇到PHP错误 严重性:错误 消息:调用未定义的方法Post::where() 文件名:models/post.php 行号:23 这是我的编辑控制器 function editpost($postID){ $data['success']=0; if($_POST){ $data_post=array( 'title'=>$_POST['title'], 'post'=>$_POST['post'],

遇到PHP错误
严重性:错误
消息:调用未定义的方法Post::where()
文件名:models/post.php
行号:23

这是我的编辑控制器

function editpost($postID){
    $data['success']=0;
    if($_POST){
        $data_post=array(
            'title'=>$_POST['title'],
            'post'=>$_POST['post'],
            'active'=>1
        );
        $this->post->update_post($postID,$data_post);
        $data['success']=1;
    }
    $data['post']=$this->post->get_post($postID);
    $this->load->view('edit_post',$data);
}
这是我的更新模型

function update_post($postID,$data){
        $this->where('postID',$postID);
        $this->db->update('posts',$data);
    }
我更改了
数据\u post
-数据错误

我的错误在哪里?

put
$this->db->Where('postID',$postID);
$this->db->update('posts',$data)
在模型代码中

put
$this->db->where('postID',$postID);
$this->db->update('posts',$data)
在您的型号代码中

遵循以下代码:

function update_post($postID,$data){
    $this->db->where('postID',$postID);
    $this->db->update('posts',$data);
}
请将您的
update\u post
功能代码从
$this->where('postID',$postID')更改
$this->db->where('postID',$postID)。您的模型页面中缺少
->db
之前的
->where
条件

谢谢

请遵循以下代码:

function update_post($postID,$data){
    $this->db->where('postID',$postID);
    $this->db->update('posts',$data);
}
请将您的
update\u post
功能代码从
$this->where('postID',$postID')更改
$this->db->where('postID',$postID)。您的模型页面中缺少
->db
之前的
->where
条件


谢谢

在模型函数更新中发现了一个小错误\u post.put db代替$this->db->where('postID',$postID);在模型函数update_post.put db中发现一个小错误,它将db替换为$this->db->where('postID',$postID);