本文整理汇总了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;