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


PHP table::updateObject方法代码示例

本文整理汇总了PHP中table::updateObject方法的典型用法代码示例。如果您正苦于以下问题:PHP table::updateObject方法的具体用法?PHP table::updateObject怎么用?PHP table::updateObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在table的用法示例。


在下文中一共展示了table::updateObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: table

<?php

if (!isset($_GET['choose'])) {
    include '../library/loader.php';
}
$id = $_GET['id'];
$order = $_GET['order'];
$tbl_name = $_GET['tbl'];
$tbl = new table($tbl_name);
$field = array('ordering');
$values = array(format($order, 0));
$res = $tbl->updateObject($field, $values, 'id=' . $id);
开发者ID:aile54,项目名称:akachan,代码行数:12,代码来源:ajax_order.php

示例2: array

 $field = array('name', 'pass');
 if (isset($_POST["name"]) && $_POST["name"] != '') {
     $name = $_POST["name"];
     if (!Validator($name)) {
         echo "<script language='javascript'>alert('Địa chỉ email không phù hợp!');</script>";
     } else {
         if (isset($_POST["pass"]) && $_POST["pass"] != "") {
             $pass = $_POST["pass"];
             $crypt = encrypt_decrypt('encrypt', $pass);
             //var_dump($crypt);
             /*$decrypt = encrypt_decrypt('decrypt', $crypt);
             		var_dump($decrypt);*/
             if ($row) {
                 if ($crypt != $row->pass && $name != $row->name) {
                     $values = array(format($_POST["name"], 0), format($crypt, 0));
                     $res = $tbl->updateObject($field, $values, 'id=1');
                     //var_dump($res);
                     if ($res) {
                         echo "Update thành công!!!!";
                         $res = $tbl->loadOne('id=1');
                         $row = mysql_fetch_object($res);
                     }
                 }
             } else {
                 $values = array(format($_POST["name"], 0), format($crypt, 0));
                 $res = $tbl->updateObject($field, $values, 'id=1');
                 //var_dump($res);
                 if ($res) {
                     echo "Update thành công!!!!";
                     $res = $tbl->loadOne('id=1');
                     $row = mysql_fetch_object($res);
开发者ID:aile54,项目名称:akachan,代码行数:31,代码来源:account.php

示例3: table

<?php

if (isset($_GET["username"])) {
    $username = $_GET["username"];
}
$tbl = new table('admin');
if (isset($_POST["done"])) {
    // get field
    $field = array('name', 'password');
    // get value
    $values = array(format($_POST["name"], 0), format(md5($_POST["password"]), 0));
    // updateObject($field=array(),$value=array(),$where)
    $res = $tbl->updateObject($field, $values, 'per <> 0 and username=' . format($username, 0));
    if ($res) {
        echo "OK";
    }
}
$res = $tbl->loadOne('username=' . format($username, 0));
if ($res) {
    $row = mysql_fetch_array($res);
    ?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Admin</h1>
				<div class="breadcrumbs"><a href="#">Content</a> / <a href="#">Sửa</a></div>
			</div><br />
 
		  
		  
			<div class="table">
				<img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
开发者ID:aile54,项目名称:akachan,代码行数:31,代码来源:edit.php

示例4: format

    $username = format($_SESSION["log"], 0);
    // check old password
    $password = format(md5($_POST["password"]), 0);
    $res = $tbl->login($username, $password);
    if ($res == 0) {
        echo "Wrong Password!!!";
    } else {
        if ($_POST["newpassword"] != $_POST["againpassword"]) {
            echo "Again new password wrong!!!";
        } else {
            // get field
            $field = array('name', 'password');
            // get value
            $values = array(format($_POST["name"], 0), format(md5($_POST["newpassword"]), 0));
            // updateObject($field=array(),$value=array(),$where)
            $res = $tbl->updateObject($field, $values, 'username=' . $username);
            if ($res) {
                header('location: ' . loadPage(''));
            }
        }
    }
}
$res = $tbl->loadOne('username="' . $_SESSION["log"] . '"');
if ($res) {
    $row = mysql_fetch_array($res);
    ?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Change Password</h1>
				<div class="breadcrumbs"><a href="#">Content</a> / <a href="#">Sửa</a></div>
			</div><br />
开发者ID:aile54,项目名称:akachan,代码行数:31,代码来源:password.php


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