Re: WHERE statement used multiple times.
| From: | Chris Wanstrath | Date: | Mon, 20 Oct 2003 05:24:40 +0000 |
| Subject: | Re: WHERE statement used multiple times. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31137@lists.php.net to get a copy of this message | ||
On Mon, 2003-10-20 at 00:56, JeRRy wrote:
> > Hi,
> >
> > If I was to want to use the WHERE statement multiple
> > times (more than once) how do I seperate each WHERE
> > statement?
> >
> > Would it be with a ',' (coma) or a ' ' (space) or
> > what? Or not possible to have multiple WHERE's in
> > the
> > one query?
> >
> > I need 2 tables checked before executing the
> > results.
> > So that is why I need 2 WHERE statements done.
> >
> > Thanks!
> >
> > http://personals.yahoo.com.au - Yahoo! Personals
> > New people, new possibilities. FREE for a limited
> time.
You can put together WHERE statements with an AND or an OR. For
instance, "SELECT id FROM users WHERE id='2' OR id='3'"
You know, if you had a few suspicions about this sort of thing you could
always give it a spin in a Query. Worst case scenario is you will get
an error.
- Chris