1.首先加载对应的数据库类$db = load_class('db');
2.然后调用update方法$update = $db->update($table, $data, $where = ''); //$table 表名 $data 要更新的数据内容,参数可以为数组也可以为字符串,建议数组 $where更新数据的条件,可以是数组或者字符串
<?php
// +----------------------------------------------------------------------
// | wuzhicms [ 五指互联网站内容管理系统 ]
// | Copyright (c) 2014-2015 http://www.wuzhicms.com All rights reserved.
/ | Licensed ( http://www.wuzhicms.com/licenses/ )
// | Author: wangcanjia <phpip@qq.com>
// +----------------------------------------------------------------------
defined('IN_WZ') or exit('No direct script access allowed');
load_class('admin');
class index extends WUZHI_admin {
private $db;
function __construct() {
$this->db = load_class('db');
}
function edit() {
$update = $this->db->$db->update($table, $data, $where = '');//更新之后返回是以boolean类型返回
}
}