I have 4 if/else conditions, Out of 4 only 3 work fine, The values in the condition would have a combination of numeric and text, is this causing the issue.
I am not sure, can some one tell me if this is causing the issue, is there any other way of doing this.
In the below code I have mentioned the values for 2 variables passed from a form. In this scenario ideally it should go to 3rd If condition, but it goes to 4th if condition.
part of my php code:
echo "category :".$option." ".$suboption." "; //Values displayed for $option is 4 and $suboption is Nitrogen
if ($option==0 && $suboption==0)
$dc=mysql_query("SELECT Ac_code, Prod_desc, Capacity FROM RATEMASTER ORDER BY Ac_code, Prod_desc");
else{
if($option==0 && $suboption!=0)
$dc=mysql_query("SELECT Ac_code, Prod_desc, Capacity FROM RATEMASTER WHERE Prod_desc='$suboption' ORDER BY Ac_code, Prod_desc");
else{
if($option!=0 && $suboption!=0)
$dc=mysql_query("SELECT Ac_code, Prod_desc, Capacity FROM RATEMASTER WHERE Ac_code='$option' AND Prod_desc='$suboption' ORDER BY Ac_code, Prod_desc");
else{
if($option!=0 && $suboption==0)
$dc=mysql_query("SELECT Ac_code, Prod_desc, Capacity FROM RATEMASTER WHERE Ac_code='$option' ORDER BY Ac_code, Prod_desc");
}
}
}