在我的 codeigniter PHP 模型中,我有
if ($this->input->post('questions') != "")
{
if($this->input->post('questions') == "Yes")
{
$this->db->where('webinar_event.questions !=',"");
$this->db->where('webinar_event.questions IS NOT ', null, false);
}
else
{
$this->db->where('webinar_event.questions',"");
$this->db->where('webinar_event.questions IS', null, true);
}
然而,当我运行时,
echo $this->db->last_query();
我得到了这个错误
'Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
SELECT * FROM (`health_professional`) JOIN `webinar_event` ON `webinar_event`.`hpid` = `health_professional`.`hpid` WHERE `webinar_event`.`questions` = '' AND `webinar_event`.`questions` IS
Filename: D:\Development\PfizerWebinar\web\system\database\DB_driver.php
Line Number: 330'
基本上我想要做的是,如果我搜索“确实问过问题”,我会得到任何不为空的内容,如果我想搜索他们是否确实问过问题,请向我展示所有不为空的问题。