buenas , me e encontado con algo que no me lo esperaba no se si el if tenga un limite o sea infinito con el elseif, sin embargo me e topado con que no realisa algunas de las convinacionaciones que le marco, no se si tenga algun error alguien le puede echar un ojo porfavor..
Código PHP:
if ($Mun <> "" and $cult <> "" and $ren <> "" and $ten <> ""){
$most = " where municipio = '".$Mun."'";
$mos = " and a.municipio = '".$Mun."' and a.cultivo = '".$cult."' and b.tenencia = ".$ten." ".$rie."";
}
elseif ($Mun == "" and $cult <> "" and $ren <> "" and $ten <> ""){
$most = "";
$mos = " and a.cultivo = '".$cult."' and b.tenencia = ".$ten." ".$rie."";
}
elseif ($Mun <> "" and $cult == "" and $ren <> "" and $ten <> ""){
$most = " where municipio = '".$Mun."'";
$mos = " and a.municipio = '".$Mun."' and b.tenencia = ".$ten." ".$rie."";
}
elseif ($Mun <> "" and $cult <> "" and $ren == "" and $ten <> ""){
$most = " where municipio = '".$Mun."'";
$mos = " and a.municipio = '".$Mun."' and a.cultivo = '".$cult."' and b.tenencia = ".$ten."";
}
elseif ($Mun <> "" and $cult <> "" and $ren == "" and $ten == ""){ // a partir de aquí no funciona los demás si lo realisa
$most = " where municipio = '".$Mun."'";
$mos = " and a.municipio = '".$Mun."' and a.cultivo = '".$cult."'";
}
elseif ($Mun == "" and $cult == "" and $ren <> "" and $ten <> ""){
$most = "";
$mos = " and b.tenencia = ".$ten." ".$rie."";
}
elseif ($Mun <> "" and $cult == "" and $ren <> "" and $ten == ""){
$most = " where municipio = '".$Mun."'";
$mos = " and a.municipio = '".$Mun."' ".$rie."";
}
elseif ($Mun == "" and $cult <> "" and $ren <> "" and $ten == ""){
$most = "";
$mos = " and a.cultivo = '".$cult."' ".$rie."";
}
elseif ($Mun <> "" and $cult == "" and $ren == "" and $ten <> ""){
$most = " where municipio = '".$Mun."'";
$mos = " and a.municipio = '".$Mun."' and b.tenencia = ".$ten."";
}
elseif ($Mun == "" and $cult <> "" and $ren <> "" and $ten == ""){
$most = "";
$mos = " and a.cultivo = '".$cult."' ".$rie."";
}
else {
$most = "";
$mos = "";
}