Medoo

开始

Where 语句

查询

Transaction

原生SQL查询

PDO object

Debug

数据库信息

update

修改表数据

update($table, $data, $where)
Return: [number] 受影响的行数.
你可以修改没有序列化的数组, 并且能使用 [+], [-], [*], [/] 来做运算
$database->update("account", [
    "type" => "user",

    // All age plus one
    "age[+]" => 1,

    // All level subtract 5
    "level[-]" => 5,

    // All score multiplied by 2
    "score[*]" => 2,

    // Like insert, you can assign the serialization
    "lang" => ["en", "fr", "jp", "cn", "de"],

    "(JSON) fav_lang" => ["en", "fr", "jp", "cn", "de"],

    // You can also assign # for using SQL functions
    "#uid" => "UUID()"
], [
    "user_id[<]" => 1000
]);