当前位置: 首页>>代码示例>>PHP>>正文


PHP dbconnection::Update方法代码示例

本文整理汇总了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";
}
开发者ID:korabieka,项目名称:PHP_Project,代码行数:13,代码来源:resetPassword.php

示例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);
开发者ID:korabieka,项目名称:PHP_Project,代码行数:11,代码来源:cancel_order.php

示例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);
开发者ID:korabieka,项目名称:PHP_Project,代码行数:22,代码来源:delete_product.php

示例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);
开发者ID:korabieka,项目名称:PHP_Project,代码行数:29,代码来源:delete_user.php

示例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);
开发者ID:korabieka,项目名称:PHP_Project,代码行数:23,代码来源:deliver.php

示例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);
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:edit_user.php

示例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);
开发者ID:korabieka,项目名称:PHP_Project,代码行数:25,代码来源:toggle_avb.php

示例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);
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:edit_product.php


注:本文中的dbconnection::Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。