Pete Winter
asked on
php if or
Can some one please explain to me why the below does not work for me.
but if I separate to this below is does?
What am I doing wrong with the OR operator? I just want to ask if $row_rs_media_new['categor y'] is equal to 'EFI VUTEk' or 'EFI VUTEk Accessories'.
if($row_rs_media_new['category'] == 'EFI VUTEk' || 'EFI VUTEk Accessories') {
$roll_price = $row_rs_media_new['cost'];
}
but if I separate to this below is does?
if($row_rs_media_new['category'] == 'EFI VUTEk') {
$roll_price = $row_rs_media_new['cost'];
}
if($row_rs_media_new['category'] == 'EFI VUTEk Accessories') {
$roll_price = $row_rs_media_new['cost'];
}
What am I doing wrong with the OR operator? I just want to ask if $row_rs_media_new['categor
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks. Wanted to share points for the explanation.
You are welcome.
ASKER
Open in new window
but this does...
Open in new window
Does it work differently when I say not equal != ?