×
Pleas keep in mind that SPAM will be deleted instantly
Linking tables in my book database!
- admin.heartslovefree
- Topic Author
- Offline
Less
More
- Posts: 7
- Thank you received: 0
8 years 1 month ago #3812
by admin.heartslovefree
Linking tables in my book database! was created by admin.heartslovefree
Hi, i have a book database with following tables:
subject > sub_subject > sub_sub_subject > book
Finally i have a table called "book2subject", which is used to link or relate with the right subjects > book.
I cant' figure out how to link tables nor relate them to one anothor, so can i give you access to my Joomla backend, so yo can set it up for me please!
Best regards Hans
subject > sub_subject > sub_sub_subject > book
Finally i have a table called "book2subject", which is used to link or relate with the right subjects > book.
I cant' figure out how to link tables nor relate them to one anothor, so can i give you access to my Joomla backend, so yo can set it up for me please!
Best regards Hans
Please Log in to join the conversation.
- Dirk
- Offline
Less
More
- Posts: 1222
- Thank you received: 226
8 years 1 month ago #3818
by Dirk
I am not sure that I understood what you want to do.
I guess subject is a kind of a category. Your categories are hierarchical? Like this!
Books>Cooking>Seefood
Some questions:
Normally you do such stuff with nested tables. Take a look at the Joomla Categories Table.
mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
If you just want to assign your table to one subject,sub_subject or sub_sub_subject you can insert 3 integer fields in your book-table and assign the table n:1 to your database adding subtemplates. JooDB will do the rest.
books:id_subject<=>subject::id
books:id_subject2<=>sub_subject::id
books:id_subject3<=>sub_sub_subject::id
Replied by Dirk on topic Linking tables in my book database!
admin.heartslovefree wrote: Hi, i have a book database with following tables:
subject > sub_subject > sub_sub_subject > book
Finally i have a table called "book2subject", which is used to link or relate with the right subjects > book.
I am not sure that I understood what you want to do.
I guess subject is a kind of a category. Your categories are hierarchical? Like this!
Books>Cooking>Seefood
Some questions:
- Why do you have so many tables?
- Does a book has only one subject and one sub_subject ...?
Normally you do such stuff with nested tables. Take a look at the Joomla Categories Table.
mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
If you just want to assign your table to one subject,sub_subject or sub_sub_subject you can insert 3 integer fields in your book-table and assign the table n:1 to your database adding subtemplates. JooDB will do the rest.
books:id_subject<=>subject::id
books:id_subject2<=>sub_subject::id
books:id_subject3<=>sub_sub_subject::id
Please Log in to join the conversation.
Moderators: Dirk, joest