数据行更新Adapter类
默认在SQL语句末尾增加 limit 1, 当参数$limit被设置成0时, 代表关闭update保险杠
public bool update(array $data [, array $condition = array() [, int $limit = 1]])
需要一个关联数组 key => value 键值对
判断条件
默认值1, 简称保险杠, 设置0关闭
SQLite 数据库不生效
true 代表成功, false 代表失败
<?php
$configs = array(
'dsn' => array('host' => '127.0.0.1', 'dbname' => 'test', 'port' => 6666),
'username' => 'test',
'password' => 'AbcdefRDvgedf',
);
$mysql = new Asf_Db_Adapter_Mysql($configs);
$mysql->setTableName('test1');
// UPDATE `test1` SET `pass` = ? WHERE `user` = ?
// bindValue: time(), lisi
$data = array('pass' => time());
$where = array('user' => 'lisi');
var_dump($mysql->update($data, $where));