ecmall 数据库操作
2015-07-13 17:19
495 查看
$model为实例化模型对象;
1.查询一条数据
//$id 主键值
2.查询多条数据 并分页
3.统计数据条数
添加信息成功失败跳转
分佣:
1.查询一条数据
//$id 主键值
$model->get_info($id);
2.查询多条数据 并分页
$page = $this->_get_page(); $datas = $model->find(array( 'conditions' => '1=1' . $conditions, 'limit' => $page['limit'], 'count' => true, 'order' => 'sort_order', )); $this->_format_page($page); $this->assign('page_info', $page);
3.统计数据条数
$count = $model->getCount();
//自定义数据操作 $sql = "UPDATE {$mod_goods->table} " . "SET cate_id_1 = '{$cate_id_n[0]}', cate_id_2 = '{$cate_id_n[1]}', cate_id_3 = '{$cate_id_n[2]}', cate_id_4 = '{$cate_id_n[3]}' " . "WHERE cate_id = '$cate_id'"; $mod_goods->db->query($sql);
$row = $store_mod->get(array( 'conditions' => $param['store_id'], 'fields' => 'store_name' ));
添加信息成功失败跳转
if ($this->_authaccount_mod->get_error()) { $this->show_warning('添加失败'); //$this->show_warning($this->_authaccount_mod->get_error()); return; } $this->show_message('添加成功', '','index.php?app=my_authaccount' );
分佣:
$money['money_pt'] = round(0.19 * $order_res['fmoney'],2);
相关文章推荐
- 【Oracle】数据库运行状态下物理删除所有redo日志恢复方法
- MySQL5.6 读写分离
- SQLPLUS常用命令
- SQL Server 2005 查看数据库表的大小 按照表大小排列
- SQL Server 2005 查看数据库表的大小 按照表大小排列
- MongoDB for node.js developers 七周学习-最终测试小结(1)
- SQL Sever——无法连接到(local)。“未配置远程连接”和“请求失败或服务未及时响应”
- mysql下如何执行sql脚本
- oracle中怎样获取当前月上个月的第一天和最后一天?
- SQL Sever——远程过程调用失败(0x800706be)
- WinCE程序不能访问sql2000数据库
- oracle官方文档_查看初始化参数(举例)
- percona-xtrabackup 备份
- 一步一步在sqlserver中创建分区表
- mysql存入数据出错总结
- MySQL中间层 Atlas
- 【sql】JDBC连接数据库(详细)
- 安装绿色版的mysql
- 数据库并发控制 你选乐观锁还是悲观锁?
- MongoDB高级查询详细