NULL
DBに存在するのに、なぜまだ答えが得られるのかわかりません。DBにない値に対しても取得しているため、挿入する必要があります。
モデル:
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);
}