Re: finder (I AM REALLY SORRY)

From: Date: Fri, 17 Jul 2009 13:07:55 +0000
Subject: Re: finder (I AM REALLY SORRY)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-46335@lists.php.net to get a copy of this message
Hi List, Am I the only one who's getting the feeling that we're doing Emiliano's JOB here? Maybe he should try posting a job opening at his company to this list, instead of letting us solve all his problems and write his entire application for him. I'm all for helping each other out, but this has just been a stepwise build-up of how to write his real-estate application. Just my two cents, ----- Original Message ----- From: "Emiliano Boragina" <emiliano.boragina@gmail.com> To: <php-db@lists.php.net> Sent: Friday, July 17, 2009 12:16 AM Subject: [PHP-DB] finder (I AM REALLY SORRY) Sorry a lot of times!!! Please... tell me (and help me) to know if this is right: <? include "conn.php"; $sql = "SELECT * FROM principal FULL JOIN detalles FULL JOIN aestrenar FULL JOIN fotos ON principal.id=detalles.id=aestrenar.id=fotos.id ORDER BY id ASC"; $result=mysql_query($sql,$conn); $row=mysql_fetch_row($result); $f_codigo = $_REQUEST['codigo']; $f_inmueble = $_REQUEST['inmueble']; $f_operacion = $_REQUEST['operacion']; $f_desde = $_REQUEST['fpreciodesde']; $f_hasta = $_REQUEST['fpreciohasta']; $f_moneda = $_REQUEST['moneda']; $f_region = $_REQUEST['region']; $f_barrio = $_REQUEST['barrio']; $f_ambientes = $_REQUEST['ambientes']; $f_dependencia = $_REQUEST['dependencia']; $f_cochera = $_REQUEST['cochera']; $f_ubicacion = $_REQUEST['ubicacion']; $f_apto = $_REQUEST['apto']; if(($f_desde <= 0) || ($f_desde == "")) { $f_desde = 0; } if(($f_hasta <= 0) || ($f_hasta == "")) { $f_hasta = 0; } if(($f_ambientes <= 0) || ($f_ambientes == "")) { $f_ambientes = 0; } $f_precio = $f_desde >= $row['precio'] <= $f_hasta; if($f_codigo == "") {
        $sql_BUSQUEDA = "SELECT * FROM principal FULL JOIN detalles WHERE
'";
        if ($f_inmueble > 0) { $sql_BUSQUEDA .= " inmueble LIKE
'%$f_inmueble%' "; }
        if ($f_operacion > 0) { $sql_BUSQUEDA .= "AND operacion LIKE
'%$f_operacion%' "; }
        if ($f_precio) { $sql_BUSQUEDA .= "AND precio = '$f_precio' "; }
        if ($f_moneda == 1) { $sql_BUSQUEDA .= "AND moneda = '$f_moneda' ";
}
        if ($f_moneda == 2) { $sql_BUSQUEDA .= "AND moneda = '$f_moneda' ";
}
        if ($f_region > 0) { $sql_BUSQUEDA .= "AND region LIKE
'%$f_region%' "; }
        if ($f_barrio > 0) { $sql_BUSQUEDA .= "AND barrio LIKE
'%$f_barrio%' "; }
        if ($f_ambientes > 0) { $sql_BUSQUEDA .= "AND ambientes LIKE
'%$f_ambientes%' "; }
        if ($f_dependencia > 0) { $sql_BUSQUEDA .= "AND dependencia LIKE
'%$f_dependencia%' "; }
        if ($f_cochera > 0) { $sql_BUSQUEDA .= "AND cochera LIKE
'%$f_cochera%' "; }
        if ($f_ubicacion > 0) { $sql_BUSQUEDA .= "AND ubicacion LIKE
'%$f_ubicacion%' "; }
        if ($f_apto > 0) { $sql_BUSQUEDA .= "AND apto LIKE '%$f_apto%' "; }
        $sql_BUSQUEDA .= " ORDER BY principal.id DESC";
        $result = mysql_query($sql_BUSQUEDA,$conn);
} else {
        $sql_BUSQUEDA = "SELECT * FROM principal FULL JOIN detalles WHERE
codigo = '$f_codigo'";
        $result=mysql_query($sql_BUSQUEDA,$conn);
        $row=mysql_fetch_row($result);
} ?> Thanks a lot!
+                                                                          _
// Emiliano Boragina _ // Diseño & Comunicación //////////////////
+                                                                          _
// emiliano.boragina@gmail.com / // 15 40 58 60 02 ///////////////////////////
+                                                                          _


« previous php.db (#46335) next »