Currently I have 3 tables countries, routes and route_place
countries
- id
- name
table routes
- id
- title
table route_place
- id
- parent_id (id from table routes)
- from (id from countries)
- to (id from countries)
- place_name
I have 3 destination China - Dubai - London from countries table, currently I save the data into route_place table like this:
- China (from column) - Dubai (to column)
- Dubai (from column) - London (to column)
I wanted to save the data into the route_place like this
- China (from column) - Dubai (to column)
- China (from column) - London (to column)
- Dubai (from column) - London (to column)
I couldnt figured the logic after an hour, is there any method or some guidelines for it
for instance, I submitted China - Dubai - London routes, and manually choose routes place by sequence
- China - Dubai
- Dubai - London
what I wanna do is it will automatically create another route from China to London without needing me to insert manually, because China to is one way trip to London too by sequence.