Questions about php document classification

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.