include (“conexion.php”); $anio=@$_POST[“res_anio”]; $numero1=@$_POST[“nro_res”]; $res_descripcion=@$_POST[“tag”]; if ($anio==’TOD’) { if ($numero1 <> ”){//<– si el campo es distinto a vacio busca en $selects= “select * from web.resoluciones where res_nro=$numero1 y busca el numero ingresado” $selects= “select * from web.resoluciones where res_nro=$numero1″; }elseif($res_descripcion<>”){ $selects= “select * from web.resoluciones where res_tags like ‘%$res_descripcion%’ order by res_anio,res_nro”; //con los valores LIKE busca palabras similares a lo ingresado para mayor presicion usar ‘%%’ } else { $selects= “select * from web.resoluciones”; //si no coloco nada en los campos busca todo el contenido de la base de datos }}else{if ($numero1 <> ”){ $selects= “select * from web.resoluciones where res_anio=’$anio’ and res_nro=$numero1 order by res_anio,res_nro”; } elseif($res_descripcion<>”){ $selects= “select * from web.resoluciones where res_anio=’$anio’ and res_tags like ‘%$res_descripcion%’ order by res_anio,res_nro”; } else{ $selects= “select * from web.resoluciones where res_anio=’$anio’ order by res_anio,res_nro “; } } //$selects= “select * from web.resoluciones where res_anio=’$anio’ and res_nro=’$numero1′ and res_descripcion=’$res_descripcion'”; $query_id=mysql_query($selects, $conexion); echo ” “;echo “Nº RESOLUCIÓN“;
|
“;
?>
[/insert_php]