ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
##### 编辑数据 ~~~ $Sql -> edit($table,$field,$where,$other); ~~~ ##### 参数说明 > * $table [必选]表名 > * $field [必选] 导入数据数组(字段名=>字段值[特殊处理需用数组]) > * $where [必选] 判断语句数组 > * $other [可选] 辅助参数 > 1. echo 输出类型(0:执行状态布尔值,1:打印语句) > 2. forced 强制数据更新(0:不判断,1:判断) > 3. limit 限制更新条数 ##### 回调信息 > 若为强制更新(forced)则直接返回布尔值 > succeed 执行状态[0:失败,1:成功] > msg 提示信息 ##### 实例 - 直接编辑 ~~~ $field = []; $field['字段名'] = '字段值'; $where = []; $where[] = '字段值="'.字段值.'"'; $back = $Sql -> edit($table,$field,$where); ~~~ ##### 实例 - 只输出语句 ~~~ $field = []; $field['字段名'] = '字段值'; $field['字段名'] = ['字段名'+1]; $where = []; $where[] = '字段值="'.字段值.'"'; $back = $Sql -> edit($table,$field,$where,['echo'=>1]); ~~~ ##### 实例 - 事务只输出语句 ~~~ $field = []; $field['字段名'] = '字段值'; $where = []; $where[] = '字段值="'.字段值.'"'; $step[] = $Sql -> edit($table,$field,$where,['echo'=>1]); ~~~ ##### 实例 - 事务输出语句并强制数据变更 ~~~ $field = []; $field['字段名'] = '字段值'; $where = []; $where[] = '字段值="'.字段值.'"'; $step[] = [$Sql->edit($table,$field,$where,['echo'=>1]),'forced'=>1]; ~~~