更新方法:Update API-Medoo使用指南
2014-05-17 15:06
489 查看
上一篇《插入方法:Insert API-Medoo使用指南》中介绍了如何使用Medoo的Insert方法来保存数据,本篇将告诉你如何使用Update方法来修改数据库已有的数据。
更新方法:Update
修改数据库中的数据。
返回值: [number] 受到影响的行数
提示:和插入方法insert()一样,你可以修改数组数据,而不需序列化,并且可以使用[+]和[- ]来增加或减少数值。
Medoo版本: 0.9.1.1
原文标题: 更新方法:Update API-Medoo使用指南
原文链接: http://loiy.net/post/581.html
更新方法:Update
修改数据库中的数据。
update($table, $data, $where) //table [string]: 表名 //data [array]:数据库中将要被修改的数据 //where (可选) [array]:WHERE子句筛选记录
返回值: [number] 受到影响的行数
提示:和插入方法insert()一样,你可以修改数组数据,而不需序列化,并且可以使用[+]和[- ]来增加或减少数值。
$database = new medoo("my_database"); $database->update("account", [ "type" => "user", // 所有年龄都加1 "age[+]" => 1, // 所有级别(level)都减5 "level[-]" => 5, "lang" => ["en", "fr", "jp", "cn", "de"] ], [ "user_id[<]" => 1000 ]);
Medoo版本: 0.9.1.1
原文标题: 更新方法:Update API-Medoo使用指南
原文链接: http://loiy.net/post/581.html
相关文章推荐
- Has方法:Has API-Medoo使用指南
- 数据库信息方法:Info API-Medoo使用指南
- 取得方法:Get API-Medoo使用指南
- 删除方法:Delete API-Medoo使用指南
- 统计方法:Count API-Medoo使用指南
- 引用方法:Quote API-Medoo使用指南
- 替换方法:Replace API-Medoo使用指南
- 最后查询方法:Last Query API-Medoo使用指南
- 求和方法:Sum API-Medoo使用指南
- 平均值方法:Avg API-Medoo使用指南
- 错误方法:Error API-Medoo使用指南
- Medoo Update的使用:修改更新数据
- github使用指南(2015年3月23日更新了本地创建仓库再推送到remote仓库的使用方法)
- 使用Controller.UpdateModel方法来更新ViewModel
- 关于Jpa使用Update方法进行更新操作,却没有同步到数据库的原因
- <为知更新>windows下使用android隐藏api的方法
- Min方法:Min API-Medoo使用指南
- 网站后台登录aspcms 提示错误号:-2147467259,错误描述:操作必须使用一个可更新的查询。sql=update AspCms_Content set TimeStatus=0 where TimeStatus=1 and Timeing <= 解决方法。
- C#使用SqlDataAdapter的Update方法更新数据
- 使用Controller.UpdateModel方法来更新ViewModel