Esempio n. 1
0
 $sql = "select * from users where phone_number=:phone";
 $sth = $conn->prepare($sql);
 $sth->bindValue("phone", $phone);
 try {
     $sth->execute();
 } catch (Exception $e) {
     //echo $e->getMessage();
 }
 $result = $sth->fetchAll(PDO::FETCH_ASSOC);
 if (count($result)) {
     $success = "1";
     $msg = "Phone Number already taken";
     $phn_status = 1;
     $body = "Verification Code for Gander is " . $v_code;
     try {
         DataClass::sendSMS($phone, $body);
     } catch (Exception $e) {
     }
 } else {
     $success = 1;
     if ($apn_id) {
         $sql = "update users set apn_id='' where apn_id=:apn_id";
         $sth = $conn->prepare($sql);
         $sth->bindValue('apn_id', $apn_id);
         try {
             $sth->execute();
         } catch (Exception $e) {
         }
     }
     //$body="Verification Code for Gander is ".$v_code;
     $sql = "INSERT INTO `codebrew_gander`.`users` (`id`, `apn_id`, `username`, `password`, `photo`, `phone_number`, `verification_code`,`is_verified`, `is_deleted`, `created_on`) \n\tVALUES (DEFAULT, :apn_id, :username, :password,:photo, :phone,:vcode, 0, 0, NOW())";