tengo un codigo que me sirve de conexion para todos
Código PHP:
<?
include('adodb5/adodb.inc.php');
$serv="192.168.0.53";
$user="Scott";
$pass="web";
$db="BDESA";
$con=& ADONewConnection("oracle");
if(!$con->Connect($serv,$user,$pass,$db)){
echo "Error de conexion con el servidor";
die();
}
?>
Código PHP:
<?
include('conexion.php');
$c='operacion="'.$_POST['operacion'].'"';
$c.=($_POST['tipo']!="0")?' and tipo="'.$_POST['tipo'].'"':'';
$c.=($_POST['distrito']!=0)?' and distrito="'.$_POST['distrito'].'"':'';
$c.=($_POST['p1']!=0)?' and precio>='.$_POST['p1']:'';
$c.=($_POST['p2']!=0)?' and precio<='.$_POST['p2']:'';
$c.=($_POST['nro_cuartos']!=0)?'and nro_cuartos>='.$_POST['nro_cuartos']:'';
$c.=($_POST['antiguedad']!=0)?' and antiguedad<='.$_POST['antiguedad']:'';
$c.=($_POST['total_m2']!=0)?' and total_m2>='.$_POST['total_m2']:'';
[COLOR="Red"]$sql="SELECT id,Operacion,Tipo,Distrito,Precio,Nro_Cuartos,Antiguedad,Total_m2 FROM inmueble WHERE ".$c;
echo $sql;
$result = mysql_query($sql, $link);
while ($row = mysql_fetch_row($result)){
echo $row[0]."&".$row[1]."&".$row[2]."&".$row[3]."&".$row[4]."&".$row[5]."&".$row[6]."&".$row[7]."^";[/COLOR]}
?>
gracias de antemano.....
