Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Recursive infinite classification notes

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Recently, projects have been launched to consolidate php knowledge every day. The following is a comparison of recursive infinite classification for your reference!

Database a table on it, add a parendid field that is sub-classification, sorting we can also add fields.

CREATE TABLE `roomy` (`id` int (11) NOT NULL, `name` varchar (255) CHARACTER SET utf8 DEFAULT NULL, `sort_ order` int (11) DEFAULT NULL, `parendid` int (11) DEFAULT NULL, PRIMARY KEY (`id`) ENGINE=InnoDB DEFAULT CHARSET=latin1 -Records of category-- INSERT INTO `roomy` VALUES ('1mm,' mobile phone', null,'0'); INSERT INTO `roomy` VALUES ('2mm,' home appliances', null,'0') INSERT INTO `roomy`VALUES ('3million,' Furniture', null,'0'); INSERT INTO `roomy`VALUES ('4million,' Nokia', null,'1'); INSERT INTO `roomy`VALUES ('5', 'Apple', null,'1'); INSERT INTO `roomy`VALUES ('6', 'refrigerator', null,'2'); INSERT INTO `roomy`VALUES ('74th,' TV', null,'2') INSERT INTO `roomy` VALUES ('880,' cabinet', null,'3'); INSERT INTO `roomy` VALUES ('999,' table', null,'3'); INSERT INTO `roomy`VALUES ('10mm,' Nokia 3310mm, null,'4'); INSERT INTO `roomy`VALUES ('111mm,' Apple 8slots, null,'5'); INSERT INTO `roomy`VALUES ('1250,' Haier refrigerator', null,'6') INSERT INTO `roomy` VALUES ('1300,' Changhong TV', null,'7'); INSERT INTO `roomy`VALUES ('1400,' mahogany cabinet', null,'8'); INSERT INTO `roomy`VALUES ('15mm,' mahogany table', null,'9')

Php code section

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report