Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Linking Tables 22 Sep 2012 16:09 #3850

  • sdm7001
  • sdm7001's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Please be patient with me as I am a noob.

I am trying to link tables using the foreign key but I am not sure how to do it in this platform.

OK, stop laughing. I have looked all over this forum and have not found an answer or a How To Manual.

I appreciate the assistance.

SDM

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

Last edit: by admin.

Re: Linking Tables 22 Sep 2012 17:00 #3852

  • sdm7001
  • sdm7001's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Sorry ...thought I had figured it out but I was unsuccessful. Any help would be sincerely appreciated.

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

Re: Linking Tables 22 Sep 2012 17:25 #3854

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi and welcome!
  1. Ok so lets say your tables are called table1 and table2 and you have an id and title for each.
  2. Table1 is your main table, table2 your secondary table containing related records for each in table1.
  3. Add a field of typeForeign Key to table 1 and call it Foreign.
  4. Once you've saved that field, you'll notice a box in the foreign table column of your fields grid with a broken line (- - - - ).
  5. Drag table 2 from the tables list on the left into this area.
  6. Now, when you add a Page (layout) for table1, drag all of it's available fields to the layout, you'll be able to edit the properties of that field on the layout to select which related field you want to be displayed as it's labe - for example, title. This will store table2.id as the value but display it's title.

Hope this helps!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The following user(s) said Thank You: admin, sdm7001

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

Re: Linking Tables 22 Sep 2012 17:27 #3855

  • sdm7001
  • sdm7001's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Thank you very much!!

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

Re: Linking Tables 22 Sep 2012 17:30 #3857

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Check it works before you thank me LOL
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Linking Tables 22 Sep 2012 17:44 #3859

  • sdm7001
  • sdm7001's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Works great. The only thing I don't see the the visual connection between the tables.

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

Re: Linking Tables 22 Sep 2012 17:53 #3860

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
You can see the ERD in the projects tab by clicking database - I think.

Glad it helped!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Linking Tables 22 Sep 2012 17:55 #3861

  • sdm7001
  • sdm7001's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
A simple refresh took care of it.

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

Re: Linking Tables 22 Sep 2012 17:57 #3862

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Great!
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

  • Page:
  • 1
Time to create page: 0.221 seconds

First of all... I have to congratulate you guys for the awesome tool... I came here only to see what this thing was up to and I have to tell that I'm very impressed with what this tool can do. French guys are making a revolution on Joomla... first with Seblod and now Cook...
Griiettner (forum)

Get Started