我不确定为什么我仍然得到答案,NULL
即使它确实存在于数据库中。我也得到了一个不在数据库中的值,它应该被插入。
模型:
function pageURLCheck($title, $id)
{
$this->db->select('post_title, website_id');
$this->db->where('post_title', $title);
$this->db->where('website_id', $id);
$query = $this->db->get($this->_table['posts']);
}
控制器:
$urlCheck = $this->page_model->pageURLCheck($post['post_title'], $website_id);
if($urlCheck == NULL)
{
$this->session->set_flashdata('flash', 'Page Title Exists', 'error');
}else{
$save_success = $this->page_model->save($post, $action, $post_id);
}