Jump to content

Relating Tables using REL_


FrobinRobin

Recommended Posts

Hi all, (my first time post :D )

 

I came across an example database where tables were related using REL_ and seperated by _ _ (double underscore i.e.  REL_table1__table2)

 

PHPMyAdmin reads the table as a collapsable tree and which I really like.

 

I only use this relation from my own interpretation (creating table1 on it's own, and only creating table 2 within the REL_ table)

so my table list would be:

table1

REL_table1

    REL_table1__table2

 

I've looked on the internet but cannot find any information on it? Can someone please point me in the right direction to learn how to use this correctly? (btw: I have rtfm)

 

Many thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/37447-relating-tables-using-rel_/
Share on other sites

Thanks Effigy,

 

Would what I've done be considered incorrect or (more importantly) detrimental to my database?

 

table_a

ID, name

 

REL_table_a__table_b

ID, table_a_ID, description

 

SELECT table_a.name, table_b.description FROM table_a, REL_table_a__table_b WHERE table_a.ID = REL_table_a__table_b.table_a_ID

 

**Pls excuse my bad sql example**

I understand why not to use ID in the REL_ table (not needed as table_a_ID in the REL_ table is sufficient) - I may now remove it.

 

Also - what was your query for google? I cant seem to find the right words and I'd really like more information on the usage of "REL_" neither of your examples mentioned "REL_"

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.