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