PHP Advanced: Achieve Infinite Classification 1th/4 page _php Tips

Source: Internet
Author: User
1. Analysis

When we make a website in PHP, the classification is very important, and then the second classification is classified under the classification, which is called the secondary classification, and now most of the site classification is only divided into the third category:

First classification (parent classification)--> second classification (subcategory)--> Third classification (sun classification)

The more kinship classifications, the more complex and difficult the control of procedures and databases becomes. Classification processing and control at the same level is very simple, because only need a database to record this level of classification on the line, such as: System, news and other classifications, at this level of processing is very simple, but for a site to the level of classification is not enough , you also need to classify them, such as:

System-->linux,windows
News-->linux News, Windows News

So the classification is clearer, at least to make it clear that the system includes Linux and Windows, while the news includes Linux news and Windows News, in order to make the information more clear, then continue to classify:

linux--> system Tools, kernels, programming languages, development tools
...

Classification to the third level, the processing of information is more clear, in other words, in order to deal with the data very clearly, the more detailed classification of the more convenient, so that the convenience of processing information and user-friendly purpose to find the necessary information clearly, but with the continuous refinement of classification, in the process and database control will become more and more difficult.

Difficulty one: How do you handle these interconnected relationships in a database?
Difficulty two: How to use PHP to complete this clear relationship?

This classification is a lot of detail of the problem that every PHP programmer must solve, because the creation of a good and excellent site classification problem is inevitable, and solve this problem is quite complex, the biggest problem is the database classification processing, Because if the database is improperly handled, it will create a huge workload and even have to redesign the database ...

This is not exaggeration, because many people in the database processing will use the first level classification to establish a database practice, I was also adopted this method to deal with the classification, because most of the site is divided into the third level, so the database only need three classification database to deal with. But when you need to continue sorting down, The drawbacks of this approach are revealed, because the more down, the workload, the program will be a huge increase.

I want to introduce this method is how to use a classification database to create an unlimited downward classification method, users who have used Windows know that Windows folder can create an unlimited hierarchical directory, you can continue to create a directory under the directory, so the endless division, Linux Directory creation, which is the same as the one I'm introducing.
Current 1/4 page 1234 Next read the full text

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.