add_增加数据

mysql_add

接口描述

增加表单 和 插入数据

懒人调用例子

```language function moapi:mysql_add(cJson) --创建表单 cJson = cJson or { --模式0 创建表单 ["ms"] = "0"; --表单名称 ["tb"] = "mysql"; --字段名称 ["key"] = "id,nema,key"; --字段大小 默认建议是255 或者 512 ["key_size"] = "255"; --设置唯一索引 可以多个 ["key_id"] = "id,nema" } --插入一行 数据 存在相同会失败 cJson = cJson or { --模式1 插入一行 数据 ["ms"] = "1"; --表单名称 ["tb"] = "mysql"; --字段名称 ["key"] = "id,nema,key"; -- 插入数据 按字段顺序插入 有多少个字段必须写多少个否则会失败 ["key_str"]= "0,565922935,tk"; } --插入多行 数据 cJson = cJson or { --模式2 插入一行 数据 ["ms"] = "2"; --表单名称 ["tb"] = "mysql"; --字段名称 ["key"] = "id,nema,key"; -- 插入数据 按字段顺序插入 有多少个字段必须写多少个否则会失败 <|>作为分割 最多不超过1000个 ["key_str"]= "chnohup ./main& 后台运行<|>ps -ef 查找全部进程<|>wget 下载文件 url<|>chmod 777 main<|>chmod 777 main"; } local lurl = string.format("http://%s/mysql/mysql_add?nema=%s&tkmy=%s",self.IP,self.nema,self.tkmy); local localJson = httpPost(lurl,jsonLib.encode(cJson)) or "" if localJson ~= "" then localJson = jsonLib.decode(localJson) if localJson["ret"] == "1" then return true,localJson end end return false end ```