當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DbHandler::updateOneRecord方法代碼示例

本文整理匯總了PHP中DbHandler::updateOneRecord方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbHandler::updateOneRecord方法的具體用法?PHP DbHandler::updateOneRecord怎麽用?PHP DbHandler::updateOneRecord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DbHandler的用法示例。


在下文中一共展示了DbHandler::updateOneRecord方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: function

    }
});
$app->post('/resetPassword', function () use($app) {
    require_once 'passwordHash.php';
    $response = array();
    $r = json_decode($app->request->getBody());
    $password_non = $r->password;
    if (strtolower($password) == $password_non) {
        $response["status"] = "error";
        $response["message"] = "Need at least 1 capital letter in password";
        echoResponse(201, $response);
        $app->stop();
    }
    if (!preg_match('/[0-9]+/', $password_non)) {
        $response["status"] = "error";
        $response["message"] = "Need at least 1 number in password";
        echoResponse(201, $response);
        $app->stop();
    }
    $password = passwordHash::hash($password_non);
    $key = $r->key;
    $db = new DbHandler();
    $dbemail = $db->getOneRecord("select email from confirm where validation_key='{$key}'");
    $email = $dbemail['email'];
    $dbuid = $db->getOneRecord("select uid from users where email='{$email}'");
    $uid = $dbuid['uid'];
    $db->updateOneRecord("update users set password = '{$password}' where uid='{$uid}'");
    $response["status"] = "success";
    $response["message"] = "Account password sucessfully reset.";
    echoResponse(200, $response);
});
開發者ID:allanjeng,項目名稱:Project_FTSD,代碼行數:31,代碼來源:authentication.php

示例2: echoResponse

    $response["status"] = "success";
    $response["message"] = "Moved '{$tm}' to '{$tn}'";
    echoResponse(200, $response);
});
$app->post('/removeTM', function () use($app) {
    $response = array();
    $r = json_decode($app->request->getBody());
    $tm = $r->tm;
    if ($tm == "") {
        $response["status"] = "error";
        $response["message"] = "Cannot remove '{$tm}' Select valid teammate.";
        echoResponse(200, $response);
        $app->stop();
    }
    $db = new DbHandler();
    $db->updateOneRecord("update users set teamname = NULL where name='{$tm}'");
    $response["status"] = "success";
    $response["message"] = "Removed '{$tm}'";
    echoResponse(200, $response);
});
$app->post('/assignRole', function () use($app) {
    $response = array();
    $r = json_decode($app->request->getBody());
    $fr = $r->fr;
    $rc = $r->rc;
    $db = new DbHandler();
    $result = $db->getOneRecord("select uid,teamname from users where name='{$fr}'");
    $confirm_tabble_name = "user_roles";
    $confirm_column_names = array('id', 'name', 'teamname', 'role', 'uid');
    $content = array('id' => 'NULL', 'name' => $fr, 'teamname' => $result['teamname'], 'role' => $rc, 'uid' => $result['uid']);
    $object = json_decode(json_encode($content), FALSE);
開發者ID:allanjeng,項目名稱:Project_FTSD,代碼行數:31,代碼來源:management.php


注:本文中的DbHandler::updateOneRecord方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。