我已经集成了 Jamie Rumbelow My Model,用于使用来自 github 的 codeigniter 进行事件记录查询 - https://github.com/jamierumbelow/codeigniter-base-model
SELECT * FROM `user` WHERE user_id =1 and phone_no is not null;
我想在 MyModel 中使用这个 MySQL 查询,并且我已经尝试过了。
$data['user_details'] = $this->user_details_model->get_many_by(array('user_id' => $user_id, 'phone_no' =>NULL));
上面的工作正常,但我想做相反的is not null
。请帮助我。谢谢
最佳答案
试试这个:
$data['user_details'] = $this->user_details_model->get_many_by(array('user_id' => $user_id, 'phone_no !=' =>NULL));
也许这也有效:
$data['user_details'] = $this->user_details_model->get_many_by(array('user_id' => $user_id, 'phone_no IS NOT' =>NULL));
关于php - 如何在 MY_Model 中传递 (is not null),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40547776/