Re: Genius help required with PHP MySQL problem
| From: | jeremy brand | Date: | Fri, 22 Dec 2000 03:38:02 +0000 |
| Subject: | Re: Genius help required with PHP MySQL problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31527@lists.php.net to get a copy of this message | ||
Of course, the best way is to just leave off the leading AND.
SELECT * from cars where trans = 'automatic';
Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
Get your own Free, Private email at http://www.smackdown.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com
On Thu, 21 Dec 2000, jeremy brand wrote:
> Date: Thu, 21 Dec 2000 19:34:51 -0800 (PST)
> From: jeremy brand <jeremy@nirvani.net>
> To: Sefton <c.sefton@xtra.co.nz>
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Genius help required with PHP MySQL problem
>
> This is always true, so you could add:
>
> SELECT * from cars where 1=1 AND trans = 'automatic';
> ^^^
> This has tremendous hack value. ;)
>
> Enjoy,
> Jeremy Brand
>
> Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
> http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for
> more
> Get your own Free, Private email at http://www.smackdown.com/
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> "<body>" -- Quoted from Yahoo! homepage,
> http://www.yahoo.com
>
> On Fri, 22 Dec 2000, Sefton wrote:
>
> > Date: Fri, 22 Dec 2000 16:22:52 +1300
> > From: Sefton <c.sefton@xtra.co.nz>
> > To: php-general@lists.php.net
> > Subject: [PHP] Genius help required with PHP MySQL problem
> >
> > Hello Everybody,
> >
> > I am trying to return some results from MySql using PHP.
> >
> > What I have is this...
> >
> > SELECT * FROM cars WHERE make =
> >
> > It is after the equals that I want something that will select all of them. I
> > know I could just have
> > SELECT * FROM cars
> > and leave it at that, but my problem occurs when I have another selection
> >
> > SELECT * FROM cars WHERE make = 'honda' AND trans = 'automatic'
> >
> > Becuase I am depending on what comes in from select boxes, if they don't
> > select a make the code i have returns...
> > SELECT * FROM car AND trans = 'automatic'
> > This doesn't work for obvious reasons!
> >
> > So what I am after is something that will always if otherwise decided in the
> > select box place
> > WHERE make =
> > Whatever command will list the lot.
> >
> > I have tried WHERE make = *
> > WHERE make = '*'
> > WHERE make = *.*
> > etc
> >
> > Is it possible?
> >
> > Please Help
> >
> >
> > Thanks
> >
> > Chris
> > Alias Dr nick
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>