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