其中条件不适用于Mysql搜索

时间:2017-11-11 18:05:02

标签: php mysql codeigniter

这是codeignitor中的MySQL查询

$query = $this->db->select('stu_id as id, CONCAT(UCASE(stu_fname), " ", UCASE(stu_mname), " ", UCASE(stu_lname), " - ", stu_id) as text')
                    ->like('stu_fname', $this->input->get("q"), 'after')
                    ->or_like('stu_mname', $this->input->get("q"), 'after')
                    ->or_like('stu_lname', $this->input->get("q"), 'after')
                    ->where('stu_status', '0')
                    ->limit(10)
                    ->from('student')
                    ->get();

一切正常,我收到搜索结果,但WHERE条件不起作用,stu_status = 1行没有被省略,这里我只想要stu_status = 0行。任何人都可以帮助解决问题吗?

0 个答案:

没有答案