Welcome, Guest
Username: Password: Remember me
Pleas keep in mind that SPAM will be deleted instantly
  • Page:
  • 1

TOPIC:

Linking tables in my book database! 5 years 7 months ago #3812

  • admin.heartslovefree
  • admin.heartslovefree's Avatar Topic Author
  • Offline
  • Posts: 7
  • Karma: -1
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

Linking tables in my book database! 5 years 6 months ago #3818

  • Dirk
  • Dirk's Avatar
  • Offline
  • Posts: 1185
  • Karma: 21
  • Thank you received: 224

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 or Create an account to join the conversation.

  • Page:
  • 1
Moderators: Dirkjoest