2. 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.