本文整理匯總了PHP中DbHandler::isUserExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbHandler::isUserExists方法的具體用法?PHP DbHandler::isUserExists怎麽用?PHP DbHandler::isUserExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DbHandler
的用法示例。
在下文中一共展示了DbHandler::isUserExists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: function
});
/**
* Get user
* url - /get-user
* method - POST
* params - email
*/
$app->post('/get-user', function () use($app) {
// check for required params
verifyRequiredParams(array('nome', 'telefone'));
// reading post params
$nome = $_REQUEST["nome"];
$telefone = $_REQUEST["telefone"];
$response = array();
$db = new DbHandler();
if ($db->isUserExists($nome, $telefone)) {
// get the user by email
$user = $db->getUserByTelefone($email);
if ($user != NULL) {
$response["error"] = false;
$response["cd_usuario"] = $user["cd_usuario"];
$response["nome"] = $user["nome"];
$response["email"] = $user["email"];
$response["endereco"] = $user["endereco"];
$response["telefone"] = $user["telefone"];
$response["empresa"] = $user["empresa"];
$response["tipo_entrega"] = $user["tipo_entrega"];
$response["api_key"] = $user["api_key"];
} else {
// unknown error occurred
$response['error'] = true;
示例2: DbHandler
$password_hash = passwordHash::hash($password);
echo $password_hash;
// validating email address
// validateEmail($email);
$db = new DbHandler();
$profileMaster = new profile_master();
$profileMaster->setFirstName($firstName);
$profileMaster->setLastName($surName);
$profileMaster->setMobileNumber($mobileNumber);
$profileMaster->setEmailId($emailId);
$profileMaster->setUserName($userName);
$profileMaster->setPassword($password_hash);
$profileMaster->setStatus('00');
$profileMaster->setGender($gender);
$profileMaster->setLastOpuser('admin');
if (!$db->isUserExists($emailId)) {
$profile_id = $profileMaster->save();
$response["profileId"] = $profile_id;
if ($profile_id > -1) {
$response["status"] = "00";
$response["message"] = "PROFILE_CREATED_SUCCESSFULLY";
} else {
$response["status"] = "99";
$response["message"] = "PROFILE_CREATE_FAILED";
}
// return $response;
} else {
// User with same email already existed in the db
$response["status"] = "55";
$response["message"] = "PROFILE_ALREADY_EXISTED";
// return $response;