回复讨论(解决方案)
- -- 表的结构 `product`-- CREATE TABLE `product` ( `p_id` int(15) NOT NULL AUTO_INCREMENT, `p_name` varchar(100) NOT NULL, `p_cccid` varchar(100) NOT NULL, `p_ccid` varchar(15) NOT NULL, `p_cid` varchar(100) NOT NULL, `p_imgurl` varchar(100) NOT NULL, `p_content` varchar(1000) NOT NULL, `p_number` varchar(15) NOT NULL, `p_sortid` varchar(15) NOT NULL, `p_scroll` varchar(15) NOT NULL DEFAULT '0', `p_sortidd` varchar(15) NOT NULL, PRIMARY KEY (`p_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=31 ;-- -- 导出表中的数据 `product`-- INSERT INTO `product` VALUES (4, '4', '22', '38', '24', 'upload/1287706504.jpg', '你死我活 ', 'PL6389999999999', '0022', '0', '22');INSERT INTO `product` VALUES (6, '6', '19', '36', '23', 'upload/1287706041.bmp', '', 'PL3999555555', '0021', '0', '21');INSERT INTO `product` VALUES (7, '7', '17', '35', '24', 'upload/1287706041.bmp', '', 'PL3999', '0020', '0', '20');INSERT INTO `product` VALUES (8, '8', '', '38', '24', 'upload/20101023124900.jpg', '现在的的很好用 ', 'TCSS36666', '0019', '0', '19');INSERT INTO `product` VALUES (10, '10', '21', '38', '24', 'upload/20101023125120.jpg', '现在的的很好用 ', 'PL336699', '0018', '1', '18');INSERT INTO `product` VALUES (11, '11', '18', '36', '23', 'upload/20101027201020.jpg', '', '23331', '0017', '1', '17');INSERT INTO `product` VALUES (12, '11', '22', '38', '24', 'upload/20101027204003.jpg', '', '54645', '0016', '1', '16');INSERT INTO `product` VALUES (13, 'sdfasdfds', '16', '35', '24', 'upload/20101027204346.jpg', 'sdfsd ', 'asdfasdfsd', '0015', '0', '15');INSERT INTO `product` VALUES (14, 'sefas', '16', '35', '24', 'upload/20101027204531.jpg', 'sdafsd ', 'sdfa', '0014', '0', '14');INSERT INTO `product` VALUES (17, 'sdfds', '22', '38', '24', 'upload/20101027210346.jpg', '', '23331', '0013', '0', '13');INSERT INTO `product` VALUES (18, 'sdfds', '19', '36', '23', 'upload/20101027211354.gif', '', 'asdfasdfsd', '0012', '0', '12');INSERT INTO `product` VALUES (22, 'sdafsd', '21', '38', '24', 'upload/20101027220734.png', 'sdfds ', 'sdfds', '0008', '0', '8');INSERT INTO `product` VALUES (19, 'sdfasdfds', '16', '35', '24', 'upload/20101027213407.gif', 'dfgasd ', 'asdfasdfsd', '0011', '0', '11');INSERT INTO `product` VALUES (20, 'sdfds', '19', '36', '23', 'upload/20101027213430.gif', 'fdgdf ', 'sdf', '0010', '0', '10');INSERT INTO `product` VALUES (21, 'sdfasdfds', '22', '38', '24', 'upload/20101027213538.gif', '', 'dfg', '0009', '0', '9');INSERT INTO `product` VALUES (23, 'sdfsd', '18', '36', '23', 'upload/20101027220752.png', 'sdfds ', 'sdfsd', '0007', '0', '7');INSERT INTO `product` VALUES (24, '电刷', '23', '38', '24', 'upload/20101102132745.jpg', '', 'PL8888', '0006', '1', '6');INSERT INTO `product` VALUES (25, 'sdfasdfds', '19', '36', '23', 'upload/20101102133302.jpg', '', 'PL8888', '0005', '1', '5');INSERT INTO `product` VALUES (26, '12233', '23', '38', '24', 'upload/20101105132946.png', 'fadsfdsfds ', 'dsfdsdsfdsf', '0004', '0', '4');INSERT INTO `product` VALUES (28, 'fsda', '23', '38', '24', 'upload/20101107155144.png', '', 'sdfds', '0003', '0', '3');INSERT INTO `product` VALUES (29, 'AAAAAAA', '16', '35', '24', 'upload/20101109103038.gif', '', '888888888', '0002', '0', '2');INSERT INTO `product` VALUES (30, 'AAAAAAA', '19', '36', '23', 'upload/20101109113914.gif', '', '888888888', '0001', '0', '1');-- ---------------------------------------------------------- -- 表的结构 `public`-- -- 表的结构 `p_ccclass`-- CREATE TABLE `p_ccclass` ( `ccc_id` int(15) NOT NULL AUTO_INCREMENT, `classname` varchar(100) NOT NULL, `sortid` varchar(100) NOT NULL, `cid_ccid_cccid` varchar(100) NOT NULL, PRIMARY KEY (`ccc_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;-- -- 导出表中的数据 `p_ccclass`-- INSERT INTO `p_ccclass` VALUES (13, '贴片电容', '001', '34');INSERT INTO `p_ccclass` VALUES (14, '钽电容', '003', '34');INSERT INTO `p_ccclass` VALUES (15, '钻头', '001', '35');INSERT INTO `p_ccclass` VALUES (16, '钻线', '003', '35');INSERT INTO `p_ccclass` VALUES (12, '电解电容', '002', '34');INSERT INTO `p_ccclass` VALUES (17, '钻靠', '002', '35');INSERT INTO `p_ccclass` VALUES (18, 'SOC8950', '', '36');INSERT INTO `p_ccclass` VALUES (19, 'TP4471', '', '36');INSERT INTO `p_ccclass` VALUES (20, 'TL317', '', '36');INSERT INTO `p_ccclass` VALUES (21, '机芯', '003', '38');INSERT INTO `p_ccclass` VALUES (22, '线圈', '002', '38');INSERT INTO `p_ccclass` VALUES (23, '电刷', '001', '38');INSERT INTO `p_ccclass` VALUES (30, '手动电P', '', '52');INSERT INTO `p_ccclass` VALUES (31, '电动电P', '', '52');-- ---------------------------------------------------------- -- 表的结构 `p_cclass`-- CREATE TABLE `p_cclass` ( `cc_id` int(15) NOT NULL AUTO_INCREMENT, `classname` varchar(100) NOT NULL, `sortid` varchar(100) NOT NULL, `cid_ccid` varchar(100) NOT NULL, PRIMARY KEY (`cc_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=53 ;-- -- 导出表中的数据 `p_cclass`-- INSERT INTO `p_cclass` VALUES (36, 'IC', '002', '23');INSERT INTO `p_cclass` VALUES (38, '电动机', '002', '24');INSERT INTO `p_cclass` VALUES (52, '电P', '', '23');INSERT INTO `p_cclass` VALUES (35, '电钻配件', '001', '24');-- ---------------------------------------------------------- -- 表的结构 `p_class`-- CREATE TABLE `p_class` ( `c_id` int(15) NOT NULL AUTO_INCREMENT, `classname` varchar(100) NOT NULL, `sortid` varchar(15) NOT NULL, PRIMARY KEY (`c_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ;-- -- 导出表中的数据 `p_class`-- INSERT INTO `p_class` VALUES (23, '电子产品', '001');INSERT INTO `p_class` VALUES (24, '电动工具', '002'); 再修改数据的时候你要根据产品的那个分类父ID读取该父ID的子类 然后循环 js触发onchange事件,然后AJAX查询二级分类,JS插入数据 用ajax将二级分类数据取回来插入 还未解决,有代码参考一下吗 还未解决,有代码参考一下吗
参考 上边那段功能已实现了,只是需要修改产品时读取到相关的二级分类,现在修改产品是读不到相关对应的二级分类出来, 上边那段功能已实现了,只是需要修改产品时读取到相关的二级分类,现在修改产品是读不到相关对应的二级分类出来, 没看到我在2#说的话??
在修改数据的时候你要根据产品的那个分类父ID读取该父ID的子类
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
相关文章
相关视频
|