1.获取单条记录 $row = $GLOBALS['db']->getRow($sql); 2.获取单一字段 $row = $GLOBALS['db']->getOne($sql); 查询产品总数 $num = $GLOBALS['db']->getOne(‘SELECT COUNT(*) FROM ‘ . $GLOBALS['ecs']->table(‘goods’) ; 3.获取所有记录 $row = $GLOBALS['db']->getAll($sql); 4.执行sql语句 $res = $GLOBALS['db']->query($sql); //执行删除(DELETE),插入(INSERT),更新(UPDATE)等操作可用此方法 5.把数组元素插入数据库 $parent['goods_number'] = ’1′; $parent['parent_id'] = 0; $GLOBALS['db']->autoExecute($GLOBALS['ecs']->table(‘cart’), $parent, ‘INSERT’);