Php advanced implementation of unlimited classification 2_PHP tutorial-php Tutorial

Source: Internet
Author: User
Php advanced implementation of unlimited Classification 2. 2. database planning -------------------------------------------------------------- the complexity of classification is discussed earlier. Therefore, it is very important to plan a database to implement unlimited classification. database planning -------------------------------------------------------------- as we talked about the complexity of classification, it is very important to plan a database to implement unlimited classification. I have introduced the database planning of the Forum. good news is that the forum can achieve unlimited follow-up, and unlimited classification is an extension of this form. classification is also a parent association, therefore, the classification database is how to establish the parent relationship clearly. There are several difficulties. 1) How to store information of various categories; 2) how to process kinship of different categories; 3) How to query information; the process of relational databases is similar to that of Forum databases, here we create a type database for processing classification: create field: id (int): used to record the natural serial number uid (int) of each classification ): id of the parent category used to record the category type (char): Category name roue_id (varchar): kinship tree, with: 0: 2: 10: 20: the id connection indicates the relationship between the source and source roue_char (varchar): kinship tree, similar to: System: linux: development tool: gcc: (whether this field does not matter, to make it easier to understand the kinship, of course, the character expression is more direct than the numerical expression ^ o ^, but it is best to add this field) this is an infinitely classified category table, next, you need to create a database to store information. it is most convenient to process and query a table. here, you need to create a table storage information: type_message: id (int): Information serial number; typeid (int ): id of the category; title (varchar): Information title; message (text): Information content; time: information creation time; the two data tables can complete the infinite classification task (the auxiliary fields of the two tables are not added, and readers can add them themselves ). all the remaining tasks are handled by php.

Summary ------------------------------------------------------------ As we talked about the complexity of classification, it is very important to plan a database to implement unlimited classification...

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.