ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 数据库字段处理 > handle: 处理类型 (下面说明) > table : 表名 > other : 配置参数数组 ~~~ $Sql->alert($handle,$table,$other); ~~~ ***** # auto设置主键初始值 ~~~ $back = $Sql -> alert("auto",$table,['value'=>"100001"]); ~~~ ***** # add新增字段 ~~~ $other = []; $other['field'] = 'uuid char(36) NOT NULL default ""'; $back = $Sql -> alert("add",'table',$other); ~~~ ***** # edit编辑字段 ~~~ $other = []; $other['field1'] = 'field_1 int(10) NOT NULL default "0"'; $other['field2'] = 'field_2 char(255) NOT NULL default ""'; $back = $Sql -> alert("edit",$table,$other); ~~~ ***** # index_add索引新增 ~~~ $other = []; $other['index_name'] = 'field_1,field_2'; $back = $Sql -> alert("index_add",$table,$other); ~~~ ***** # index_del索引新增 ~~~ $other = []; $other[] = 'index_name_1'; $other[] = 'index_name_2'; $back = $Sql -> alert("index_del",$table,$other); ~~~ ***** # unique唯一索引 ~~~ $other = []; $other['field'] = ['field_1','field_2']; $other['name'] = 'unique_name'; $back = $Sql -> alert("unique",$table,$other); ~~~ *****