Read data from two tables with conditions
Posted: Wed Dec 01, 2004 6:34 am
Good morning everyone,
I need some help with the following:
I have two tables; the first contains an ID and another four coulmns with values 0 or 1 (available services).
The second table contains an auto ID and one column containg the description of services.
what i am trying to do, with php, is read the data from the first table, (only those that are true) and then display the corresponding value as read from the second table.
table 1
ID | srv1 | srv2 | srv3 | srv4 |
1 | 0 | 1 | 1 | 0 |
2 | 1 | 0 | 0 | 1 |
table 2
ID | description |
srv1 | aaa |
srv2 | bbb |
srv3 | ccc |
srv4 | ddd |
I tryied some things with arrays but cant do the true or false check.
I would appreciate your help,
Thank you in advance
John
I need some help with the following:
I have two tables; the first contains an ID and another four coulmns with values 0 or 1 (available services).
The second table contains an auto ID and one column containg the description of services.
what i am trying to do, with php, is read the data from the first table, (only those that are true) and then display the corresponding value as read from the second table.
table 1
ID | srv1 | srv2 | srv3 | srv4 |
1 | 0 | 1 | 1 | 0 |
2 | 1 | 0 | 0 | 1 |
table 2
ID | description |
srv1 | aaa |
srv2 | bbb |
srv3 | ccc |
srv4 | ddd |
I tryied some things with arrays but cant do the true or false check.
I would appreciate your help,
Thank you in advance
John