mysql - Interview question: How to print PHP three-level classification into a table for display?
漂亮男人2017-05-16 13:01:50
0
6
737
1. The structure of the classification table category is basically composed of three main fields: id, name, and parent_id 2. It needs to be printed and displayed in such a table format
3. How should I write php code? (Allows database table redesign)
What you masters want is php code In fact, it is a reordering problem. The second and third level classifications included under the first level classification,
Already set level 3, what is level 3!? Just connect it yourself twice.
This way you can get the watch you want.
php unlimited classification database design
The database is divided into three tables:
first_level, second_level, third_level
First traverse the level 3 array and throw it into the level 2 sub-item array, similar to Infinitus going in reverse
What you masters want is php code
In fact, it is a reordering problem. The second and third level classifications included under the first level classification,
Using recursive queries in SQL