带有活动记录的codeigniter join更新失败

时间:2013-09-19 13:51:28

标签: codeigniter activerecord sql-update

我尝试在已加入的更新中使用活动记录,我在这里找到一个示例应该如何使用,但在我的情况下是丢弃错误

Error Number: 1146

Table 'c1test.ci_posts,' doesn't exist

表c1test.ci_posts存在

    $data = array(
        'ci_posts.title' => $this->input->post('post_title'),
        'ci_posts.alias' => $this->input->post('post_alias'),
        'ci_posts.post' => $this->input->post('post'),
        'ci_posts.creation_date' => $this->input->post('creation_date'),
        'ci_posts.publish_date' => $this->input->post('publish_date'),
        'ci_metas.meta_title' => $this->input->post('meta_title'),
        'ci_metas.meta_keyword' => $this->input->post('meta_keyword'),
        'ci_metas.meta_description' => $this->input->post('meta_description')
    );
    $this->db->set($data);

    $this->db->where('ci_posts.id', $id);
    $this->db->where('ci_posts.id = ci_metas.post_id');
    $this->db->update('ci_posts, ci_metas');

似乎在这里

UPDATE `ci_posts,` ci_metas SET...

0 个答案:

没有答案
相关问题