SQL删除某个ID商品、列表属性,与及相关的资料呢?
2016-07-07 16:17 来源:www.chinab4c.com 作者:ecshop专家
SQL删除某个ID商品、列表属性,与及相关的资料呢? V2.7.0 。。除了删除商品,列表属性,还有没有别的要删除的?我不想删除了还有多余的信息残留,影响数据库的使用率。。 各位路过的同仁,希望你不惜手酸,赐教下。。 |
回答:
属性列表是共用的,删除了会影响其他商品的属性的. |
楼上说的对 |
参照admin/includes/lib_goods.php 中的delete_goods($goods_id)函数,就能看出有多少相关表需要删除了 /* 删除相关表记录 */ $sql = "DELETE FROM " . $GLOBALS['ecs']->table('collect_goods') . " WHERE goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_article') . " WHERE goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_attr') . " WHERE goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_cat') . " WHERE goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('member_price') . " WHERE goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('group_goods') . " WHERE parent_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('group_goods') . " WHERE goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('link_goods') . " WHERE goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('link_goods') . " WHERE link_goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('tag') . " WHERE goods_id " . db_create_in($goods_id); $GLOBALS['db']->query($sql); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('comment') . " WHERE comment_type = 0 AND id_value " . db_create_in($goods_id); $GLOBALS['db']->query($sql); |
最近更新
常用插件
- ecshop虚拟发货插件
ecshop虚拟发货插件介绍: ecshop虚拟发货插件,主要为了通过后台手动录...
- ecshop注册审核插件
ecshop插件介绍:ecshop会员注册审核插件,主要是在前台提供给注册的时候...
- ecshop没登陆情况下订单查
ecshop没登陆情况下订单查询插件,主要是针对ecshop在没有登陆的情况下...
- ecshop的oss插件
ecshop的oss插件免费共享了,oss,ecshoposs...
- ecshop订单聚合插件
ecshop订单聚合插件,主要是为了方便ecshop中订单产品到货情况的分析和...
ecshop热门问答
ecshop热门资料
ecshop红包控制
ecshop热心
ecshop度数
ecshop价格
ecshop工作量
ecshop商拋棄
ecshopCEO
ecshop环球宝贝商城
ecshop市场价格
ecshop计量单位
ecshop左右
ecshop文明
ecshop系统语言
ecshop301
ecshop老人
ecshop标签云
ecshop淘宝问题
ecshopphpadmin
ecshop错误信息
ecshop人民币
ecshop详细信息
价格分割
ecshop在线试听
ecshop求助啊!
ecmall卖家
ecshop市场售价
ecshopecs
ecshop移动手机
ecshop代理
ecshophidden