当前位置: 首页>>代码示例>>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;未经允许,请勿转载。