🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 单条数据获取方式 | 传入参 | 说明 | | --- | --- | | table | [ 必填 ] 表名 | | other | [ 选填 ] 配置参数数组 | | - field | 指定获取字段名数组,特殊用法加[]改成数组<br>如 : [count(*) as total] | | - where | 判断语句数组 | | - order | 排序语句 , 如 : "abc desc" | | - group | 分组语句 , 如 : "abc" | | echo | [ 选填 ] 只输出语句( 1是 0否 ) | | 回调参 | 说明 | | --- | --- | | [num] | 数据数组键名 | | - [field] | 单条数组键名 | * 读取单条数据 - 格式1 ~~~ $other = []; $other['where'] = ['字段名="'.搜索变量值.'"']; $row = $Sql->row($table,$other); ~~~ * 读取单条数据 - 格式2 ~~~ $other = []; $other['field'] = ['搜索字段名1','搜索字段名2']; $other['where'] = ['字段名="'.搜索变量值.'"']; $row = $Sql->row($table,$other); ~~~ * 读取单条数据 - 格式3 ~~~ $other = []; $field = []; $field[] = '搜索字段名1'; $field[] = '搜索字段名2'; $other['field'] = $field; $other['where'] = ['字段名="'.搜索变量值.'"']; $row = $Sql->row($table,$other); ~~~ * 读取单条数据 - 格式4 ~~~ $other = []; $other['field'] = ['搜索字段名1','搜索字段名2']; $where = []; $where[] = '字段名="'.搜索变量值.'"'; $other['where'] = $where; $row = $Sql->row($table,$other); ~~~ * 读取单条数据 - 格式5 ~~~ $other = []; $field = []; $field[] = '搜索字段名1'; $field[] = '搜索字段名2'; $other['field'] = $field; $where = []; $where[] = '字段名="'.搜索变量值.'"'; $other['where'] = $where; $row = $Sql->row($table,$other); ~~~ | 修订时间 | 开发版本 | | --- | --- | | 2020-09-12 | 宝知林 - 服务端 |