mysql 查询某个字段不为空(附thinkphp写法)

1.如果要写某个字段不为空,mysql的表达式应为:

假设字段为:door_open_api_key,

那么:door_open_api_key is  not null AND door_open_api_key != ""


2. thinkphp中应写为

        $Reserve_system = M('Reserve_system');
        $where = array();
        $where['door_open_api_key'] = array('exp',' is not null AND door_open_api_key != ""');
        $reserve_systems = $Reserve_system->where($where)->select();

猜你喜欢

转载自blog.csdn.net/u013288190/article/details/78567698
今日推荐