Jump to content

Splitting a row...


dannyluked

Recommended Posts

Hi,

I have 2 tables,

Table 1

ID | Name

1  |  Item 1

2  |  Item 2

 

Table 2

ID | Name        | nomb

1  | Product 1  |    1 3 5

 

I want to make something that will echo the rows in Table 2. However, if the user selects a product from 'Table 1' (like Item 1) they cant have certain item(s) from 'Table 2'.

 

Example,

If user chooses Item 1 (with id '1') they cant have a product from Table 2 because it is not compatible. Whether it is compatible is stated in the 'nomb' column. In there the ID's of none compatible items from Table 1 will be stored. At the moment the 'nomb' column states that it is not compatible with items from Table 1 that have the ID 1, 3 or 5.

 

Basically I need to split up the column 'nomb' (remove the space) and give it its own variable.

 

Further exaple,

1) User Chooses Item 2 from Table 1 so they can have the Product in Table 2

2) If user chooses Item 1 then they cant have another product because it is not compatible with Product 1 (the 'nomb' column contains the ID of Item 1)

 

Thanks in advance and I'm sorry it is so hard to understand

 

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.