当前位置: 首页>>代码示例>>PHP>>正文


PHP DB_Functions::isUserIDExisted方法代码示例

本文整理汇总了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);
开发者ID:singtolee,项目名称:PHP_END,代码行数:30,代码来源:updatingaddress.php

示例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 {
开发者ID:singtolee,项目名称:PHP_END,代码行数:31,代码来源:submitorder.php


注:本文中的DB_Functions::isUserIDExisted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。