本文整理汇总了PHP中DataSource::updateUser方法的典型用法代码示例。如果您正苦于以下问题:PHP DataSource::updateUser方法的具体用法?PHP DataSource::updateUser怎么用?PHP DataSource::updateUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSource
的用法示例。
在下文中一共展示了DataSource::updateUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirectTo
require_once "requires/datasource.php";
if (!isLoggedIn()) {
redirectTo("login.php");
} else {
include "headers/adminheader.php";
if (isset($_SESSION["currentUser"])) {
$username = $_SESSION["currentUser"];
// if the current session has a logged in user
// and the update info button was submitted, update
// their information
if (isset($_POST["updateinfosubmit"])) {
$firstName = escapeValue(trim($_POST["firstname"]));
$lastName = escapeValue(trim($_POST["lastname"]));
$phoneNumber = escapeValue(trim($_POST["phone"]));
$emailAddress = escapeValue(trim($_POST["email"]));
DataSource::updateUser($username, $firstName, $lastName, $emailAddress, $phoneNumber);
// else get current information about the username in the
// database to display
} else {
$result = DataSource::getUser("username = '{$username}'");
$row = $result->fetch_assoc();
$firstName = $row["firstName"];
$lastName = $row["lastName"];
$emailAddress = $row["emailAddress"];
$phoneNumber = $row["phoneNumber"];
}
// get the reviews for the username from the database to
// display
$reviewResult = DataSource::getUserReviews($username);
$reviews = array();
if ($reviewResult) {