本文整理汇总了PHP中dbconnection::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP dbconnection::Update方法的具体用法?PHP dbconnection::Update怎么用?PHP dbconnection::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbconnection
的用法示例。
在下文中一共展示了dbconnection::Update方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dbconnection
<?php
require_once "../include/Validation.php";
session_start();
$dbobj = new dbconnection();
$password = $_POST['password'];
$confirmPassword = $_POST['confirmPassword'];
if ($password == $confirmPassword) {
$dbobj->Update("update user set password = '" . md5($password) . "' where uname='" . $_SESSION['username'] . "'");
header('location: ../layout/index.php');
} else {
echo "password and confirm don't match";
}
示例2: json_encode
<?php
require "../include/dbconnection.php";
error_reporting(E_ALL);
$dbobj = new dbconnection();
$oid = isset($_GET['oid']) ? $_GET['oid'] : 0;
//if($oid != -1)
$upd_stm = "update orders set alive=0 where oid='{$oid}';";
$dbobj->Update($upd_stm);
$response = "done";
echo json_encode($response);
示例3: dbconnection
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
$_product = "../../layout/products.php";
session_start();
if (!isset($_SESSION['uid'])) {
echo "You are not authoriezed to enter this page. You have to login first";
exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
echo "You are not authoriezed to enter this page. Only for admins.";
exit;
}
$pid = $_GET['pid'];
$dbobj->Update("update product set `active`=false where `pid`='{$pid}'");
header("location:" . $_product . "?uid=" . $uid);
示例4: dbconnection
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
$_user = "../../layout/users.php";
session_start();
if (!isset($_SESSION['uid'])) {
echo "You are not authoriezed to enter this page. You have to login first";
exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
echo "You are not authoriezed to enter this page. Only for admins.";
exit;
}
$duid = $_GET['uid'];
if ($uid == $duid) {
echo "You are not allowed to delete yourself";
exit;
}
echo "before";
// $dbobj->Delete("delete from `user` where `uid`='$duid'");
$dbobj->Update("update user set `active`=false where `uid`='{$duid}'");
echo "after";
header("location:" . $_user . "?uid=" . $uid);
示例5: dbconnection
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$_orders = "../layout/orders.php";
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
if (!isset($_SESSION['uid'])) {
echo "You are not authoriezed to enter this page. You have to login first";
exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
echo "You are not authoriezed to enter this page. Only for admins.";
exit;
}
$oid = $_GET['oid'];
$flag = 0;
$dbobj->Update("update `orders` set `processing`=0 where `oid`='{$oid}'");
header("location:" . $_orders . "?uid=" . $uid);
示例6:
}
$_user = "../layout/users.php";
$edtuid = $_POST['edtuid'];
$rid = $_POST['rid'];
$uname = $_POST['username'];
$email = $_POST['email'];
$rname = $_POST['rnum'];
$ext = $_POST['ext'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
if ($vobj->ifUserExists($uname)) {
echo "Ussser already exists";
exit;
}
if ($vobj->ifEmailExists($email)) {
echo "email already exists";
exit;
}
// if($pwd != $cpwd){
// echo "Passwords did not match";
// exit;
// }
if (!$vobj->ifRoomExists($rname)) {
echo "Room number : " . $uname . " does not exists in the system";
exit;
}
$rid = $dbobj->getRoomId($rname);
echo "before";
$dbobj->Update("update user set `uname`='{$uname}',`email`='{$email}',`rid`='{$rid}',`ext`='{$ext}' where `uid`='{$edtuid}'");
echo "after";
header("location:" . $_user);
示例7: dbconnection
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
$_product = "../../layout/products.php";
session_start();
if (!isset($_SESSION['uid'])) {
echo "You are not authoriezed to enter this page. You have to login first";
exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
echo "You are not authoriezed to enter this page. Only for admins.";
exit;
}
$pid = $_GET['pid'];
$avb = $dbobj->SelectColumn('available', 'product', 'pid', $pid);
$avb = $avb[0];
$avb = !$avb;
$dbobj->Update("update product set `available`='{$avb}' where `pid`='{$pid}'");
header("location:" . $_product . "?uid=" . $uid);
示例8: dbconnection
// deconnection already included in Validation
session_start();
$dbobj = new dbconnection();
$vobj = new Validation();
if (!isset($_SESSION['uid'])) {
echo "You are not authoriezed to enter this page. You have to login first";
exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
echo "You are not authoriezed to enter this page. Only for admins.";
exit;
}
$_product = "../layout/products.php";
$pid = $_POST['pid'];
echo $pid;
$pname = $_POST['pname'];
$price = $_POST['price'];
$category = trim($_POST['category']);
$cid = $dbobj->SelectColumn('cid', 'category', 'cname', $category);
print_r($cid);
$cid = $cid[0];
$products = $dbobj->SelectColumn('pname', 'product', null, null);
foreach ($products as $product) {
if ($pname == $product) {
echo "product already exists";
exit;
}
}
$dbobj->Update("update product set `pname`='{$pname}',`price`='{$price}',`cid`='{$cid}' where `pid`='{$pid}'");
header("location:" . $_product . "?uid=" . $uid);