finder

finder

am 15.07.2009 13:22:40 von Emiliano Boragina

------=_NextPart_000_0018_01CA0525.6C9148F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello=85 I must to do a finder with 10 posibilities.

This 10 can be full or empty.

(sorry... I just ask this but I=92m not understand yet)

=20

I know how to do a finder about any field, but this is my first time =
with
one like this where the user can find a =93house=94 in a =93zone=94 or =
find anything
in that =93zone=94.

I must use IF the field empty SELCET... if the field is full SELECT... =
that
with all??

Please... help...

Thanks a lot

=20

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

=20


------=_NextPart_000_0018_01CA0525.6C9148F0--

Re: finder

am 15.07.2009 13:53:47 von Dan Shirah

--000e0cd6b25c36e25e046ebd3563
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

>
> Hello=85 I must to do a finder with 10 posibilities.
>
> This 10 can be full or empty.
>
> (sorry... I just ask this but I=92m not understand yet)
>
>
>
> I know how to do a finder about any field, but this is my first time with
> one like this where the user can find a =93house=94 in a =93zone=94 or fi=
nd
> anything
> in that =93zone=94.
>
> I must use IF the field empty SELCET... if the field is full SELECT... th=
at
> with all??
>
> Please... help...
>
> Thanks a lot


$house =3D $_POST['house'];
$zone =3D $_POST['zone'];
$abc =3D $_POST['abc'];

$query =3D "SELECT * FROM real_estate WHERE 1 =3D 1";
if ($house !=3D "") {
$query.=3D"AND house =3D '$house'";
}
if ($zone !=3D "") {
$query.=3D"AND zone =3D '$zone'";
}
if ($abc !=3D "") {
$query.=3D"AND abc =3D '$abc'";
}

--000e0cd6b25c36e25e046ebd3563--

RE: finder

am 15.07.2009 14:10:45 von Emiliano Boragina

------=_NextPart_000_0028_01CA052C.265C17F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

But with that it doesnt difference between full and empty field=85

If the user want search on two posibilities on ten...

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

_____ =20

De: Dan Shirah [mailto:mrsquash2@gmail.com]=20
Enviado el: Mi=E9rcoles, 15 de Julio de 2009 08:54 a.m.
Para: Emiliano Boragina
CC: php-db@lists.php.net
Asunto: Re: [PHP-DB] finder

=20

Hello=85 I must to do a finder with 10 posibilities.

This 10 can be full or empty.

(sorry... I just ask this but I=92m not understand yet)



I know how to do a finder about any field, but this is my first time =
with
one like this where the user can find a =93house=94 in a =93zone=94 or =
find anything
in that =93zone=94.

I must use IF the field empty SELCET... if the field is full SELECT... =
that
with all??

Please... help...

Thanks a lot

=20

$house =3D $_POST['house'];

$zone =3D $_POST['zone'];

$abc =3D $_POST['abc'];

=20

$query =3D "SELECT * FROM real_estate WHERE 1 =3D 1";

if ($house !=3D "") {

$query.=3D"AND house =3D '$house'";

}

if ($zone !=3D "") {

$query.=3D"AND zone =3D '$zone'";

}

if ($abc !=3D "") {

$query.=3D"AND abc =3D '$abc'";

}

=20


------=_NextPart_000_0028_01CA052C.265C17F0--

Re: finder

am 15.07.2009 14:17:13 von Dan Shirah

--000e0cd30a3c0ac923046ebd89f1
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

>
> But with that it doesnt difference between full and empty field=85
>
> If the user want search on two posibilities on ten...
>
Maybe I'm not understanding what you're asking...

Or maybe you don't understand the query...


Say your form has 10 checkboxes.

If the users picks 3 out of ten boxes and clicks submit, the example I gave
you will search your database looking for all records that match the 3 chec=
k
boxes.

if $houses equals $_POST['houses'] then $houses will be empty if the
checkbox was not clicked and will not be included in the query.

--000e0cd30a3c0ac923046ebd89f1--

RE: finder

am 16.07.2009 23:50:20 von Emiliano Boragina

------=_NextPart_000_0001_01CA0646.46DCE700
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi again=85

I searching in www and find this (to do the finder):

$sql =3D "SELECT buildings.*, citiy.* FROM buildings, city WHERE
buildings.idcity =3D city.id ";

=20

Dont understand =93building.*=94... what do it means?

Thanks.

=20

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

_____ =20

De: Dan Shirah [mailto:mrsquash2@gmail.com]=20
Enviado el: Mi=E9rcoles, 15 de Julio de 2009 09:17 a.m.
Para: Emiliano Boragina
CC: php-db@lists.php.net
Asunto: Re: [PHP-DB] finder

=20

But with that it doesnt difference between full and empty field=85

If the user want search on two posibilities on ten...

Maybe I'm not understanding what you're asking...

=20

Or maybe you don't understand the query...

=20

=20

Say your form has 10 checkboxes.

=20

If the users picks 3 out of ten boxes and clicks submit, the example I =
gave
you will search your database looking for all records that match the 3 =
check
boxes.

=20

if $houses equals $_POST['houses'] then $houses will be empty if the
checkbox was not clicked and will not be included in the query.


------=_NextPart_000_0001_01CA0646.46DCE700--

Re: finder

am 17.07.2009 00:06:48 von Corin Schedler

The * is a SQL shortcut. It means, in this case, all columns. So, in the
SQL you posted it means get all columns from the buildings and city
tables.

corin
dubdromic.com

On Thu, Jul 16, 2009 at 06:50:20PM -0300, Emiliano Boragina wrote:
> Hi again…
>
> I searching in www and find this (to do the finder):
>
> $sql = "SELECT buildings.*, citiy.* FROM buildings, city WHERE
> buildings.idcity = city.id ";
>
>
>
> Dont understand “building.*”... what do it means?
>
> Thanks.
>
>
>
> + _
> // Emiliano Boragina _
> // Diseño & Comunicación //////////////////
> + _
> // emiliano.boragina@gmail.com /
> // 15 40 58 60 02 ///////////////////////////
> + _
>
> _____
>
> De: Dan Shirah [mailto:mrsquash2@gmail.com]
> Enviado el: Miércoles, 15 de Julio de 2009 09:17 a.m.
> Para: Emiliano Boragina
> CC: php-db@lists.php.net
> Asunto: Re: [PHP-DB] finder
>
>
>
> But with that it doesnt difference between full and empty field…
>
> If the user want search on two posibilities on ten...
>
> Maybe I'm not understanding what you're asking...
>
>
>
> Or maybe you don't understand the query...
>
>
>
>
>
> Say your form has 10 checkboxes.
>
>
>
> If the users picks 3 out of ten boxes and clicks submit, the example I gave
> you will search your database looking for all records that match the 3 check
> boxes.
>
>
>
> if $houses equals $_POST['houses'] then $houses will be empty if the
> checkbox was not clicked and will not be included in the query.
>

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

Re: finder

am 17.07.2009 00:56:39 von Phpster

On Jul 16, 2009, at 5:50 PM, "Emiliano Boragina" =
> wrote:

> Hi againâ€=A6
>
> I searching in www and find this (to do the finder):
>
> $sql =3D "SELECT buildings.*, citiy.* FROM buildings, city WHERE
> buildings.idcity =3D city.id ";
>
>
>
> Dont understand â€=9Cbuilding.*â€=9D... what do it means?
>
> Thanks.
>
>
>
> + =20
> =20
> _
> // Emiliano Boragina _
> // Diseño & Comunicación //////////////////
> + =20
> =20
> _
> // emiliano.boragina@gmail.com /
> // 15 40 58 60 02 ///////////////////////////
> + =20
> =20
> _
>
> _____
>
> De: Dan Shirah [mailto:mrsquash2@gmail.com]
> Enviado el: Miércoles, 15 de Julio de 2009 09:17 a.m.
> Para: Emiliano Boragina
> CC: php-db@lists.php.net
> Asunto: Re: [PHP-DB] finder
>
>
>
> But with that it doesnt difference between full and empty fieldâ€=A6=

>
> If the user want search on two posibilities on ten...
>
> Maybe I'm not understanding what you're asking...
>
>
>
> Or maybe you don't understand the query...
>
>
>
>
>
> Say your form has 10 checkboxes.
>
>
>
> If the users picks 3 out of ten boxes and clicks submit, the example =20=

> I gave
> you will search your database looking for all records that match the =20=

> 3 check
> boxes.
>
>
>
> if $houses equals $_POST['houses'] then $houses will be empty if the
> checkbox was not clicked and will not be included in the query.
>


Select all columns ( fields ) from the building table

Bastien

Sent from my iPod=

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

Re: finder

am 17.07.2009 06:16:04 von Jack van Zanen

--0016e644d02cf33920046edf0b1a
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

and also represents poor/lazy programming (in my opinion) leaving you open
to all sorts of trouble if columns get added or deleted.

I always advise to querry exactly what you require.

Sorry for this comment but op seems to be fairly novice on SQL and could
benefit from this post.

Brgds


Jack

2009/7/17 Corin Schedler

> The * is a SQL shortcut. It means, in this case, all columns. So, in the
> SQL you posted it means get all columns from the buildings and city
> tables.
>
> corin
> dubdromic.com
>
> On Thu, Jul 16, 2009 at 06:50:20PM -0300, Emiliano Boragina wrote:
> > Hi again=85
> >
> > I searching in www and find this (to do the finder):
> >
> > $sql =3D "SELECT buildings.*, citiy.* FROM buildings, city WHERE
> > buildings.idcity =3D city.id ";
> >
> >
> >
> > Dont understand =93building.*=94... what do it means?
> >
> > Thanks.
> >
> >
> >
> > +
> _
> > // Emiliano Boragina _
> > // Dise=F1o & Comunicaci=F3n //////////////////
> > +
> _
> > // emiliano.boragina@gmail.com /
> > // 15 40 58 60 02 ///////////////////////////
> > +
> _
> >
> > _____
> >
> > De: Dan Shirah [mailto:mrsquash2@gmail.com]
> > Enviado el: Mi=E9rcoles, 15 de Julio de 2009 09:17 a.m.
> > Para: Emiliano Boragina
> > CC: php-db@lists.php.net
> > Asunto: Re: [PHP-DB] finder
> >
> >
> >
> > But with that it doesnt difference between full and empty field=85
> >
> > If the user want search on two posibilities on ten...
> >
> > Maybe I'm not understanding what you're asking...
> >
> >
> >
> > Or maybe you don't understand the query...
> >
> >
> >
> >
> >
> > Say your form has 10 checkboxes.
> >
> >
> >
> > If the users picks 3 out of ten boxes and clicks submit, the example I
> gave
> > you will search your database looking for all records that match the 3
> check
> > boxes.
> >
> >
> >
> > if $houses equals $_POST['houses'] then $houses will be empty if the
> > checkbox was not clicked and will not be included in the query.
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--=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

--0016e644d02cf33920046edf0b1a--