chihcc Posted July 2, 2005 Share Posted July 2, 2005 Hi, anyone can tell me how to solve the many -many relationship(database) problem using DW without using the extention from DW? or can suggest any simple method on solving this problem ? thanks u!! Quote Link to comment https://forums.phpfreaks.com/topic/2378-help-many-many-relationship/ Share on other sites More sharing options...
redbullmarky Posted July 15, 2005 Share Posted July 15, 2005 Hi, anyone can tell me how to solve the many -many relationship(database) problem using DW without using the extention from DW? or can suggest any simple method on solving this problem ? thanks u!! 248426[/snapback] hi can you give us a better idea of exactly what youre trying to do (ie what databases/tables) youre working with and i may be able to help cheers mark Quote Link to comment https://forums.phpfreaks.com/topic/2378-help-many-many-relationship/#findComment-7893 Share on other sites More sharing options...
obsidian Posted July 15, 2005 Share Posted July 15, 2005 Hi, anyone can tell me how to solve the many -many relationship(database) problem using DW without using the extention from DW? or can suggest any simple method on solving this problem ? thanks u!! 248426[/snapback] first off, welcome to the forums! easiest way is to create a "joining" table. basically, just a table that holds the ids of the related items, so, if i have a class->student many-many relationship, i would have a classes table, a students table, and a roll table. the roll table would only store two pieces of data: class_id and student_id. that way, i can easily see either all the classes a student is in or all the students in a particular class. Quote Link to comment https://forums.phpfreaks.com/topic/2378-help-many-many-relationship/#findComment-7901 Share on other sites More sharing options...
ecstasy Posted July 20, 2005 Share Posted July 20, 2005 Hi, anyone can tell me how to solve the many -many relationship(database) problem using DW without using the extention from DW? or can suggest any simple method on solving this problem ? thanks u!! 248426[/snapback] Hi, anyone can tell me how to solve the many -many relationship(database) problem using DW without using the extention from DW? or can suggest any simple method on solving this problem ? thanks u!! 248426[/snapback] Supposing that you are having two entities: Users: (UserId, UserName, UserPassword) Products: (ProductId, ProductDescription) Supposing that an user have more than one sales. You can store this information within an intermediate table: UsersSales with the following structure (UserId, ProductId) Your SQL will sound smth like that SELECT * FROM users [INNER|LEFT|RIGHT] JOIN UsersSales ON Users.UserId = UsersSales.UserId [INNER|LEFT|RIGHT] JOIN Products ON UserSales.ProductId = Products.ProductId WHERE UserId = x You haven't been so specific about what are you going to do. For more details about SQL JOIN you should visit: W3Schools website Quote Link to comment https://forums.phpfreaks.com/topic/2378-help-many-many-relationship/#findComment-7950 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.