FrobinRobin Posted February 7, 2007 Share Posted February 7, 2007 Hi all, (my first time post ) 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 More sharing options...
effigy Posted February 7, 2007 Share Posted February 7, 2007 I posted an example here a while back. These "rel_" prefixed tables are useful for handling n:m relationships, also called many-to-many. This may be helpful; it was the first result from a Google search. Link to comment https://forums.phpfreaks.com/topic/37447-relating-tables-using-rel_/#findComment-179130 Share on other sites More sharing options...
FrobinRobin Posted February 9, 2007 Author Share Posted February 9, 2007 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_" Link to comment https://forums.phpfreaks.com/topic/37447-relating-tables-using-rel_/#findComment-180586 Share on other sites More sharing options...
effigy Posted February 9, 2007 Share Posted February 9, 2007 What does table_b look like? Can you show some example data? I googled for "mysql many-to-many." Link to comment https://forums.phpfreaks.com/topic/37447-relating-tables-using-rel_/#findComment-180663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.