|
user的model
function userexist($tel)
{
$query = $this->db->query("select * from User where tel='".$tel."'");
if ($query) {
return TRUE;
}
return FALSE;
}
在 ake 的 controller 中调用
$tel = "13112341234";
$this->load->model('user_model');
$select_query = $this->user_model->userexist($tel);
想得到的结果是检查该手机号码在数据库中是否存在,存在则返回1,错误则返回0, 但现在遇到的问题是,不管是否存在这个电话号码,返回都是 1,请问我写错的地方是?
|
|