What is the unlimited classification of concat in PHP ?? I. Database Design :?? ---- Tablestructurefortable 'Category '-- CREATETABLE 'Category' ('id' int (11) NOTNULLauto_increment, 'catpath' varchar (255) PHP uses unlimited concat classification
?
?
I. database design:
?
?
-- Table structure for table 'Category '-- create table 'Category' ('id' int (11) not null auto_increment, 'catpath' varchar (255) default NULL, 'name' varchar (255) default NULL, primary key ('id') ENGINE = MyISAM default charset = utf8 AUTO_INCREMENT = 11; -- Dumping data for table 'Category '-- insert into 'category' VALUES (1, '0', 'Website'); insert into 'category' VALUES (2, '0-1', 'Linux OS '); INSERT INTO 'category 'values (3, '0-1', 'Apache server '); insert into 'category 'values (4, '0-1', 'MySQL database'); insert into 'category 'values (5, '0-1 ', 'php scripting language '); insert into 'category' VALUES (6, '0-1-2', 'Linux system example'); insert into 'category' VALUES (7, '0-1-2 ', 'Linux network technology'); insert into 'category 'values (8, '0-1-2 ', 'Linux security basics '); insert into 'category 'values (9, '0-1-2-7 ', 'Linux LAMP'); insert into 'category 'values (10, '0-1-3-10 ', 'Apache server ');
?
?
Here, The-link symbol of catpath is not fixed and can be selected, and other special symbols.
II. PHP code implementation:
?
?
'; * // Second display method $ space = str_repeat ('', count (explode ('-', $ row ['abspath'])-1 ); $ option. =''. $ Space. $ row ['name'].'';} Echo''. $ Option .'';?>
?
The MySQL concat function can be used to connect one or more strings.
Select concat ('Yan ', 'pei', 'Pan ')
Select 'id', 'name', concat ('id', '-', 'name') as iname
?
?
?
Association:
Simple unlimited classification class category, menus, jquery tree view?
?
?
?
?
?
?