Jump to content

Join 2 tables based on dropdown value


deezy

Recommended Posts

Hello!

 

I have a php / mysql problem that I am struggling to find the best method for.

 

The basic structure of my two tables is as follows:

 

Selection

id |  Name  |  selections

---------------------------

1 |  User1    |  12,16,22,34

2 |  User2    |  2,17,66,69 

 

 

Products

id | Product  |

-------------

4 |  Prod1    | 

5 |  Prod2    | 

 

 

My page consists of a dropdown field (containing 'Name'), when a name is selected i need to use the php explode function to loop through the 'selections' and return the product names that the selected user has ordered.

 

Is there a way to achieve this without adding any more tables as i really just need a quick fix.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/135572-join-2-tables-based-on-dropdown-value/
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.