🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
* 单条数据获取方式 | 传入参 | 说明 | | --- | --- | | table | [ 必填 ] 表名 | | other | [ 选填 ] 设置数组 | | - field | [ 选填 ] 指定获取字段名数组,特殊用法加\[\]改成数组<br>如 : [count(*) as total] | | - jointable | [ 选填 ] 两表左联接查询右表名称,必须与on同时填写<br>如 user as u(u为user表的别称) | | - on | [ 选填 ] 两表左联接查询条件,必须与jointable同时填写<br>如:u.u_id=w.u_id(u和w为两表的别称) | | - where | [ 选填 ] 判断语句数组 | | - order | [ 选填 ] 排序语句 , 如 : "abc desc" | | - limit | [ 选填 ] 显示区间语句 , 如 : "0,1" | | - double | [ 选填 ] 双数据模式 (1开启 0关闭) | | - echo | [ 选填 ] 只输出语句( 1是 0否 ) | | 回调参 | 说明 | | --- | --- | | succeed | 执行状态(1成功 0失败) | | msg | 提示信息 | | [ arr ] | 数据数组键名 | | [ sql ] | Sql语句 | * 读取单条数据 - 格式1 ~~~ $other = []; $other['where'] = ['字段名="'.搜索变量值.'"']; $row = $D_P->row($table,$other); ~~~ * 读取单条数据 - 格式2 ~~~ $other = []; $other['field'] = ['搜索字段名1','搜索字段名2']; $other['where'] = ['字段名="'.搜索变量值.'"']; $row = $D_P->row($table,$other); ~~~ * 读取单条数据 - 格式3 ~~~ $other = []; $field = []; $field[] = '搜索字段名1'; $field[] = '搜索字段名2'; $other['field'] = $field; $other['where'] = ['字段名="'.搜索变量值.'"']; $row = $D_P->row($table,$other); ~~~ * 读取单条数据 - 格式4 ~~~ $other = []; $other['field'] = ['搜索字段名1','搜索字段名2']; $where = []; $where[] = '字段名="'.搜索变量值.'"'; $other['where'] = $where; $row = $D_P->row($table,$other); ~~~ * 读取单条数据 - 格式5 ~~~ $other = []; $field = []; $field[] = '搜索字段名1'; $field[] = '搜索字段名2'; $other['field'] = $field; $where = []; $where[] = '字段名="'.搜索变量值.'"'; $other['where'] = $where; $row = $D_P->row($table,$other); ~~~ * 读取单条数据 - 格式6 ~~~ $other = []; $field = []; $field[] = '搜索字段名1'; $field[] = '搜索字段名2'; $other['jointable'] = '表名 as 别称'; $other['on'] = '两表联接查询条件'; $other['field'] = $field; $where = []; $where[] = '字段名="'.搜索变量值.'"'; $other['where'] = $where; $row = $D_P->row('表名 as 别称',$other); ~~~