Ywy Posted November 23, 2010 Share Posted November 23, 2010 I need to set a many-to-many relationship between two tables. I have a Products table, a table Documents and a table of union Producto_Documentos. I want to get deployed in the form1 all products and when I select 1 product (edit or add) see the product with the associated documents marked (checkbox) in a new page. With the extension InteracKT MX I do these two forms very easily, but I need them to php and sql server. If you could explain the logic of these forms I could change to use SQL Server. Thank you very much in advance Quote Link to comment https://forums.phpfreaks.com/topic/219631-many-to-many/ Share on other sites More sharing options...
jdavidbakr Posted November 24, 2010 Share Posted November 24, 2010 Sounds like you've got the tables set up correctly, it's just a matter of joining the tables you need. If you only need the list of documents for one product, you just need a join between the Producto_Documents table and the Documents table where the Producto_Documents table's product id is what you're looking for. If you want a list of products and their related documents, you'll do something with grouping using all three tables. There's lots you can do with those three tables, you just need to identify how you need to join them together to get the result you need. Quote Link to comment https://forums.phpfreaks.com/topic/219631-many-to-many/#findComment-1138971 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.