本文整理汇总了PHP中DB_Functions::isUserIDExisted方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_Functions::isUserIDExisted方法的具体用法?PHP DB_Functions::isUserIDExisted怎么用?PHP DB_Functions::isUserIDExisted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_Functions
的用法示例。
在下文中一共展示了DB_Functions::isUserIDExisted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
ini_set('default_charset', 'utf-8');
require_once 'include/DB_Functions.php';
$db = new DB_Functions();
// json response array
$response = array("error" => FALSE);
if (isset($_POST['userID']) && isset($_POST['building']) && isset($_POST['floor']) && isset($_POST['room'])) {
// receiving the post params
$userID = $_POST['userID'];
$building = $_POST['building'];
$floor = $_POST['floor'];
$room = $_POST['room'];
$company = $_POST['company'];
$phone = $_POST['phone'];
// check if user is already existed with this user_ID
if ($db->isUserIDExisted($userID)) {
// create a new user
$userAddress = $db->updateUserAddress($userID, $building, $floor, $room, $company, $phone);
if ($userAddress) {
$response["error"] = FALSE;
$response["userAddress"]["building"] = $userAddress["building"];
$response["userAddress"]["floor"] = $userAddress["floor"];
$response["userAddress"]["room"] = $userAddress["room"];
$response["userAddress"]["company"] = $userAddress["company"];
$response["userAddress"]["phone"] = $userAddress["phone"];
echo json_encode($response, JSON_UNESCAPED_UNICODE);
} else {
// user failed to store
$response["error"] = TRUE;
$response["error_msg"] = "Unknown error occurred in updating address!";
echo json_encode($response);
示例2: array
// json response array
$response = array("error" => FALSE);
if (isset($_POST['uid']) && isset($_POST['pnumber']) && isset($_POST['total'])) {
// receiving the post params
$uid = $_POST['uid'];
$pm = $_POST['pm'];
$dt = $_POST['dt'];
$pnumber = $_POST['pnumber'];
$total = $_POST['total'];
$usecash = $_POST['usecash'];
$usebalance = $_POST['usebalance'];
$usepoints = $_POST['usepoints'];
$outstanding = $_POST['outstanding'];
$reward = $_POST['reward'];
// check if user is already existed with this user_ID
if ($db->isUserIDExisted($uid)) {
// create a new user
$order = $db->writeOrder($uid, $pm, $dt, $pnumber, $total, $usecash, $usebalance, $usepoints, $outstanding, $reward);
if ($order) {
$response["error"] = FALSE;
$response["orderNo"]["order_ID"] = $order["order_ID"];
$response["orderNo"]["user_ID"] = $order["user_ID"];
echo json_encode($response, JSON_UNESCAPED_UNICODE);
$db->updateBP($uid, $total, $usecash, $usebalance, $usepoints);
} else {
//failed
$response["error"] = TRUE;
$response["error_msg"] = "Unknown error occurred in submitting orders!";
echo json_encode($response);
}
} else {