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
https://forums.phpfreaks.com/topic/201193-splitting-a-row/
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.