php根据用户名和手机号查询是否存在手机号码

yipeiwu_com7年前PHP代码库

话不多说,请看代码:

public function CheckMobileUser($data){
    $sql='select phone,username from wlzbpre_user where phone="'.$data['phone'].'" or username="'.$data['phone'].'" and status="1" limit 1';
    $phone=M()->query($sql);
    $phone =$phone[0]['phone'];
    $username=$phone[0]['username'];
    if(empty($phone)){
      $remark=array(
        'RespCode'=>'081',
        'RespDesc'=>'手机号/用户名不存在',
        'AcctDetails'=>array('token'=>''),
      );
    }else{
      $remark=array(
        'RespCode'=>'000',
        'RespDesc'=>'手机号已存在',
        'AcctDetails'=>array('phone'=>$phone,'username'=>$username),
      );
    }
    return $remark;
  }

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持【宜配屋www.yipeiwu.com】!

相关文章

PHP 日志缩略名的创建函数代码

复制代码 代码如下:function create_slug($string){ $slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $string)...

PHP与以太坊交互详解

自去年以来,我们正在开发区块链(Blockchain)业务。最近使用过Ethereum并使用PHP,所以我想我们应该聊聊这个话题。 这里有个前提: 1.理解区块链 2.对编程语言有了解...

The specified CGI application misbehaved by not returning a complete set of HTTP headers

是错误报告: The specified CGI application misbehaved by not returning a complete set of HTTP heade...

sae使用smarty模板的方法

Smarty是非常流行的模板系统,它分离了业务和逻辑、执行速度快,在php网站中有广泛的运用。 不过在部署到sina app engine(sae)上时出现了问题,因为sae作为云计算平...

PHP stream_context_create()作用和用法分析

作用:创建并返回一个文本数据流并应用各种选项,可用于fopen(),file_get_contents()等过程的超时设置、代理服务器、请求方式、头信息设置的特殊过程。 函数原型:res...