《PHP教程:php根據(jù)用戶名和手機(jī)號(hào)查詢是否存在手機(jī)號(hào)碼》要點(diǎn):
本文介紹了PHP教程:php根據(jù)用戶名和手機(jī)號(hào)查詢是否存在手機(jī)號(hào)碼,希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
PHP編程話不多說,請(qǐng)看代碼:
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'=>'手機(jī)號(hào)/用戶名不存在',
'AcctDetails'=>array('token'=>''),
);
}else{
$remark=array(
'RespCode'=>'000',
'RespDesc'=>'手機(jī)號(hào)已存在',
'AcctDetails'=>array('phone'=>$phone,'username'=>$username),
);
}
return $remark;
}
PHP編程以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持維易PHP!
轉(zhuǎn)載請(qǐng)注明本頁網(wǎng)址:
http://www.snjht.com/jiaocheng/1775.html