Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.