Jump to content

Many-to-Many


Ywy

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/219631-many-to-many/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/219631-many-to-many/#findComment-1138971
Share on other sites

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.