finder (I AM REALLY SORRY)

finder (I AM REALLY SORRY)

am 17.07.2009 07:16:36 von Emiliano Boragina

------=_NextPart_000_0001_01CA0684.9DE76DC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Sorry a lot of times!!!

Please... tell me (and help me) to know if this is right:

=20


include "conn.php";

=20

$sql =3D "SELECT * FROM principal FULL JOIN detalles FULL JOIN aestrenar =
FULL
JOIN fotos ON principal.id=3Ddetalles.id=3Daestrenar.id=3Dfotos.id ORDER =
BY id
ASC";

$result=3Dmysql_query($sql,$conn);

$row=3Dmysql_fetch_row($result);

=20

$f_codigo =3D $_REQUEST['codigo'];

$f_inmueble =3D $_REQUEST['inmueble'];

$f_operacion =3D $_REQUEST['operacion'];

$f_desde =3D $_REQUEST['fpreciodesde'];

$f_hasta =3D $_REQUEST['fpreciohasta'];

$f_moneda =3D $_REQUEST['moneda'];

$f_region =3D $_REQUEST['region'];

$f_barrio =3D $_REQUEST['barrio'];

$f_ambientes =3D $_REQUEST['ambientes'];

$f_dependencia =3D $_REQUEST['dependencia'];

$f_cochera =3D $_REQUEST['cochera'];

$f_ubicacion =3D $_REQUEST['ubicacion'];

$f_apto =3D $_REQUEST['apto'];

=20

if(($f_desde <=3D 0) || ($f_desde == "")) { $f_desde =3D 0; }

if(($f_hasta <=3D 0) || ($f_hasta == "")) { $f_hasta =3D 0; }

if(($f_ambientes <=3D 0) || ($f_ambientes == "")) { $f_ambientes =3D =
0; }

$f_precio =3D $f_desde >=3D $row['precio'] <=3D $f_hasta;

=20

if($f_codigo == "")

{

$sql_BUSQUEDA =3D "SELECT * FROM principal FULL JOIN detalles =
WHERE
'";

if ($f_inmueble > 0) { $sql_BUSQUEDA .=3D " inmueble LIKE
'%$f_inmueble%' "; }

if ($f_operacion > 0) { $sql_BUSQUEDA .=3D "AND operacion LIKE
'%$f_operacion%' "; }

if ($f_precio) { $sql_BUSQUEDA .=3D "AND precio =3D '$f_precio' =
"; }

if ($f_moneda == 1) { $sql_BUSQUEDA .=3D "AND moneda =3D =
'$f_moneda' ";
}

if ($f_moneda == 2) { $sql_BUSQUEDA .=3D "AND moneda =3D =
'$f_moneda' ";
}

if ($f_region > 0) { $sql_BUSQUEDA .=3D "AND region LIKE
'%$f_region%' "; }

if ($f_barrio > 0) { $sql_BUSQUEDA .=3D "AND barrio LIKE
'%$f_barrio%' "; }

if ($f_ambientes > 0) { $sql_BUSQUEDA .=3D "AND ambientes LIKE
'%$f_ambientes%' "; }

if ($f_dependencia > 0) { $sql_BUSQUEDA .=3D "AND dependencia =
LIKE
'%$f_dependencia%' "; }

if ($f_cochera > 0) { $sql_BUSQUEDA .=3D "AND cochera LIKE
'%$f_cochera%' "; }

if ($f_ubicacion > 0) { $sql_BUSQUEDA .=3D "AND ubicacion LIKE
'%$f_ubicacion%' "; }

if ($f_apto > 0) { $sql_BUSQUEDA .=3D "AND apto LIKE =
'%$f_apto%' "; }

$sql_BUSQUEDA .=3D " ORDER BY principal.id DESC";

$result =3D mysql_query($sql_BUSQUEDA,$conn);

}

else

{

$sql_BUSQUEDA =3D "SELECT * FROM principal FULL JOIN detalles =
WHERE
codigo =3D '$f_codigo'";

$result=3Dmysql_query($sql_BUSQUEDA,$conn);

$row=3Dmysql_fetch_row($result);

}

?>

=20

Thanks a lot!

=20

+ =
_
// Emiliano Boragina _
// Dise=F1o & Comunicaci=F3n //////////////////
+ =
_
// emiliano.boragina@gmail.com /
// 15 40 58 60 02 ///////////////////////////
+ =
_

=20


------=_NextPart_000_0001_01CA0684.9DE76DC0--

Re: finder (I AM REALLY SORRY)

am 17.07.2009 07:28:25 von Jack van Zanen

--0016369fa335ba81b3046ee00e56
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

not quite

if $f_inmueble > 0 is false (<=3D0) than this will not be part of the searc=
h
and the next line will add a AND following the WHERE which is syntax error

so try this:

$sql_BUSQUEDA =3D "SELECT * FROM principal FULL JOIN detalles WHERE
1=3D1 '"; //1=3D1 is always true

if ($f_inmueble > 0) { $sql_BUSQUEDA .=3D " AND inmueble LIKE
'%$f_inmueble%' "; }


2009/7/17 Emiliano Boragina

> Sorry a lot of times!!!
>
> Please... tell me (and help me) to know if this is right:
>
>
>
> >
> include "conn.php";
>
>
>
> $sql =3D "SELECT * FROM principal FULL JOIN detalles FULL JOIN aestrenar =
FULL
> JOIN fotos ON principal.id=3Ddetalles.id=3Daestrenar.id=3Dfotos.id ORDER =
BY id
> ASC";
>
> $result=3Dmysql_query($sql,$conn);
>
> $row=3Dmysql_fetch_row($result);
>
>
>
> $f_codigo =3D $_REQUEST['codigo'];
>
> $f_inmueble =3D $_REQUEST['inmueble'];
>
> $f_operacion =3D $_REQUEST['operacion'];
>
> $f_desde =3D $_REQUEST['fpreciodesde'];
>
> $f_hasta =3D $_REQUEST['fpreciohasta'];
>
> $f_moneda =3D $_REQUEST['moneda'];
>
> $f_region =3D $_REQUEST['region'];
>
> $f_barrio =3D $_REQUEST['barrio'];
>
> $f_ambientes =3D $_REQUEST['ambientes'];
>
> $f_dependencia =3D $_REQUEST['dependencia'];
>
> $f_cochera =3D $_REQUEST['cochera'];
>
> $f_ubicacion =3D $_REQUEST['ubicacion'];
>
> $f_apto =3D $_REQUEST['apto'];
>
>
>
> if(($f_desde <=3D 0) || ($f_desde == "")) { $f_desde =3D 0; }
>
> if(($f_hasta <=3D 0) || ($f_hasta == "")) { $f_hasta =3D 0; }
>
> if(($f_ambientes <=3D 0) || ($f_ambientes == "")) { $f_ambientes =3D =
0; }
>
> $f_precio =3D $f_desde >=3D $row['precio'] <=3D $f_hasta;
>
>
>
> if($f_codigo == "")
>
> {
>
> $sql_BUSQUEDA =3D "SELECT * FROM principal FULL JOIN detalles WHE=
RE
> '";
>
> if ($f_inmueble > 0) { $sql_BUSQUEDA .=3D " inmueble LIKE
> '%$f_inmueble%' "; }
>
> if ($f_operacion > 0) { $sql_BUSQUEDA .=3D "AND operacion LIKE
> '%$f_operacion%' "; }
>
> if ($f_precio) { $sql_BUSQUEDA .=3D "AND precio =3D '$f_precio' "=
; }
>
> if ($f_moneda == 1) { $sql_BUSQUEDA .=3D "AND moneda =3D '$f_=
moneda' ";
> }
>
> if ($f_moneda == 2) { $sql_BUSQUEDA .=3D "AND moneda =3D '$f_=
moneda' ";
> }
>
> if ($f_region > 0) { $sql_BUSQUEDA .=3D "AND region LIKE
> '%$f_region%' "; }
>
> if ($f_barrio > 0) { $sql_BUSQUEDA .=3D "AND barrio LIKE
> '%$f_barrio%' "; }
>
> if ($f_ambientes > 0) { $sql_BUSQUEDA .=3D "AND ambientes LIKE
> '%$f_ambientes%' "; }
>
> if ($f_dependencia > 0) { $sql_BUSQUEDA .=3D "AND dependencia LIK=
E
> '%$f_dependencia%' "; }
>
> if ($f_cochera > 0) { $sql_BUSQUEDA .=3D "AND cochera LIKE
> '%$f_cochera%' "; }
>
> if ($f_ubicacion > 0) { $sql_BUSQUEDA .=3D "AND ubicacion LIKE
> '%$f_ubicacion%' "; }
>
> if ($f_apto > 0) { $sql_BUSQUEDA .=3D "AND apto LIKE '%$f_apto%' =
"; }
>
> $sql_BUSQUEDA .=3D " ORDER BY principal.id DESC";
>
> $result =3D mysql_query($sql_BUSQUEDA,$conn);
>
> }
>
> else
>
> {
>
> $sql_BUSQUEDA =3D "SELECT * FROM principal FULL JOIN detalles WHE=
RE
> codigo =3D '$f_codigo'";
>
> $result=3Dmysql_query($sql_BUSQUEDA,$conn);
>
> $row=3Dmysql_fetch_row($result);
>
> }
>
> ?>
>
>
>
> Thanks a lot!
>
>
>
> +
> _
> // Emiliano Boragina _
> // Dise=F1o & Comunicaci=F3n //////////////////
> +
> _
> // emiliano.boragina@gmail.com /
> // 15 40 58 60 02 ///////////////////////////
> +
> _
>
>
>
>


--=20
Jack van Zanen

-------------------------
This e-mail and any attachments may contain confidential material for the
sole use of the intended recipient. If you are not the intended recipient,
please be aware that any disclosure, copying, distribution or use of this
e-mail or any attachment is prohibited. If you have received this e-mail in
error, please contact the sender and delete all copies.
Thank you for your cooperation

--0016369fa335ba81b3046ee00e56--

Re: finder (I AM REALLY SORRY)

am 17.07.2009 15:07:55 von Yves Sucaet

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"
To:
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 ///////////////////////////
+ _






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: finder (I AM REALLY SORRY)

am 17.07.2009 15:24:12 von Emiliano Boragina

Jajajajaja no Yves... really I dont want you for do my job... for that I
said "I'm really sorry" because I understand what do yo think. I reading =
and
writing code testing all... I ask for you because not undertand =
something
complicated like this multifinder... I see a lot of finder tutorials
searching all without selecting data search... I'm thinking I must write
more than 100 lines for particular search, but with the hel of he list I =
see
not... I do a code with the help of a web... and help from you, list.

Sorry if you think that... but itsnt...
Thanks a lot...

+ =
_
// Emiliano Boragina _
// Dise=F1o & Comunicaci=F3n //////////////////
+ =
_
// emiliano.boragina@gmail.com /
// 15 40 58 60 02 ///////////////////////////
+ =
_

-----Mensaje original-----
De: Yves Sucaet [mailto:yves.sucaet@usa.net]=20
Enviado el: Viernes, 17 de Julio de 2009 10:08 a.m.
Para: php-db@lists.php.net
Asunto: Re: [PHP-DB] finder (I AM REALLY SORRY)

Hi List,

Am I the only one who's getting the feeling that we're doing Emiliano's =
JOB=20
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=20
application for him.

I'm all for helping each other out, but this has just been a stepwise=20
build-up of how to write his real-estate application.

Just my two cents,

----- Original Message -----=20
From: "Emiliano Boragina"
To:
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 =3D "SELECT * FROM principal FULL JOIN detalles FULL JOIN aestrenar =
FULL
JOIN fotos ON principal.id=3Ddetalles.id=3Daestrenar.id=3Dfotos.id ORDER =
BY id
ASC";

$result=3Dmysql_query($sql,$conn);

$row=3Dmysql_fetch_row($result);



$f_codigo =3D $_REQUEST['codigo'];

$f_inmueble =3D $_REQUEST['inmueble'];

$f_operacion =3D $_REQUEST['operacion'];

$f_desde =3D $_REQUEST['fpreciodesde'];

$f_hasta =3D $_REQUEST['fpreciohasta'];

$f_moneda =3D $_REQUEST['moneda'];

$f_region =3D $_REQUEST['region'];

$f_barrio =3D $_REQUEST['barrio'];

$f_ambientes =3D $_REQUEST['ambientes'];

$f_dependencia =3D $_REQUEST['dependencia'];

$f_cochera =3D $_REQUEST['cochera'];

$f_ubicacion =3D $_REQUEST['ubicacion'];

$f_apto =3D $_REQUEST['apto'];



if(($f_desde <=3D 0) || ($f_desde == "")) { $f_desde =3D 0; }

if(($f_hasta <=3D 0) || ($f_hasta == "")) { $f_hasta =3D 0; }

if(($f_ambientes <=3D 0) || ($f_ambientes == "")) { $f_ambientes =3D =
0; }

$f_precio =3D $f_desde >=3D $row['precio'] <=3D $f_hasta;



if($f_codigo == "")

{

$sql_BUSQUEDA =3D "SELECT * FROM principal FULL JOIN detalles =
WHERE
'";

if ($f_inmueble > 0) { $sql_BUSQUEDA .=3D " inmueble LIKE
'%$f_inmueble%' "; }

if ($f_operacion > 0) { $sql_BUSQUEDA .=3D "AND operacion LIKE
'%$f_operacion%' "; }

if ($f_precio) { $sql_BUSQUEDA .=3D "AND precio =3D '$f_precio' =
"; }

if ($f_moneda == 1) { $sql_BUSQUEDA .=3D "AND moneda =3D =
'$f_moneda' ";
}

if ($f_moneda == 2) { $sql_BUSQUEDA .=3D "AND moneda =3D =
'$f_moneda' ";
}

if ($f_region > 0) { $sql_BUSQUEDA .=3D "AND region LIKE
'%$f_region%' "; }

if ($f_barrio > 0) { $sql_BUSQUEDA .=3D "AND barrio LIKE
'%$f_barrio%' "; }

if ($f_ambientes > 0) { $sql_BUSQUEDA .=3D "AND ambientes LIKE
'%$f_ambientes%' "; }

if ($f_dependencia > 0) { $sql_BUSQUEDA .=3D "AND dependencia =
LIKE
'%$f_dependencia%' "; }

if ($f_cochera > 0) { $sql_BUSQUEDA .=3D "AND cochera LIKE
'%$f_cochera%' "; }

if ($f_ubicacion > 0) { $sql_BUSQUEDA .=3D "AND ubicacion LIKE
'%$f_ubicacion%' "; }

if ($f_apto > 0) { $sql_BUSQUEDA .=3D "AND apto LIKE =
'%$f_apto%' "; }

$sql_BUSQUEDA .=3D " ORDER BY principal.id DESC";

$result =3D mysql_query($sql_BUSQUEDA,$conn);

}

else

{

$sql_BUSQUEDA =3D "SELECT * FROM principal FULL JOIN detalles =
WHERE
codigo =3D '$f_codigo'";

$result=3Dmysql_query($sql_BUSQUEDA,$conn);

$row=3Dmysql_fetch_row($result);

}

?>



Thanks a lot!



+ =
_
// Emiliano Boragina _
// Dise=F1o & Comunicaci=F3n //////////////////
+ =
_
// emiliano.boragina@gmail.com /
// 15 40 58 60 02 ///////////////////////////
+ =
_






--=20
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php