The classification of php articles is like this. [windows & nbsp; 7 news] and [Windows & nbsp; 8.1 & nbsp; news] are & nbsp; [] Level 2 Category id & nbsp; parent & nbsp; name1 & nbsp; & php document classification
For example, the database is like this. [windows 7 news] and [Windows 8.1 news] are the secondary categories of [Microsoft news ].
Id parent name
1 0 Microsoft information
2 1 windows 7 News
3 1 windows 8.1 News
How can I display this classification in php?
For example, csdn's Breadcrumb Navigation
CSDN> CSDN Forum> High-Performance Development> distributed computing/Hadoop
And
CSDN> CSDN Forum> post
------ Solution --------------------
Here is my method:
SELECT 'id', 'parent', 'name ',
(SELECT 'name' FROM 'Category 'AS p WHERE c. 'parent' = p. 'id') as p_name
FROM 'Category 'AS c WHERE id = '2'
Result:
Then perform the operation in the template.
If p_name is not displayed, p_name is not displayed.
P_name = name of the parent category
------ Solution --------------------
Isn't that okay?
------ Solution --------------------
You can refer to the Infinitus classification, but you can also do so. The important thing is to look at your data processing section, if SEO optimization is required, you can ask the specific requirements to be adjusted.