Re: [PHP] switch()

2006-08-29 Thread John Meyer
') { // do something } ? when I tried to use swiitch() ?php switch (true) { case ($result['col_1'] == 'value_1'): // do something break; case ($result['col_2'] == 'value_2'): // do something break; } ? it will give me

Re: [PHP] switch()

2006-08-29 Thread afan
Why do you want to use a switch in this particular instance. You're comparing apples and oranges (in this case, col_1 and col_2). You use swithc to evaluate one variable against a number of choice, not multiple variables against variable choices. I'm not comparing apples and oranges - just

Re: [PHP] switch()

2006-08-29 Thread John Meyer
[EMAIL PROTECTED] wrote: Why do you want to use a switch in this particular instance. You're comparing apples and oranges (in this case, col_1 and col_2). You use swithc to evaluate one variable against a number of choice, not multiple variables against variable choices. I'm not