Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
83 views
in Technique[技术] by (71.8m points)

html - How to implement nested location and store it in a database with PHP/MySQL?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For each location you add is_a_group and parent data. Each location must have unique ID(like every other data in the database).

If you want to create location(or something else) that is collection of other things(like Asia on provided image), set is_a_group to 1. When you load data with is_a_group = 1, show all data with parent equal to ID of data where is_a_group is set to 1.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...