RE: [PHP] MySQL SELECT question
| From: | Don Read | Date: | Thu, 16 Nov 2000 04:51:06 +0000 |
| Subject: | RE: [PHP] MySQL SELECT question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25599@lists.php.net to get a copy of this message | ||
On 16-Nov-00 Ben Wiechman wrote:
> Since I couldn't seem to uncover a decent example...
>
strange that, there are 65 examples of it's use in the manual.
> Can I use multiple where clauses in a select statement?
> i.e.
>
> SELECT FROM table WHERE this = 'that'AND thishere = 'thatthere'
>
Yes, but with a space before the AND
> And another question...
>
> I have a date field in my table
>
> Is it possible to match, for example, only the month?
>
> i.e.
>
> SELECT * FROM table WHERE FORMAT_DATE( DATE, %m ) = '<value from 1-12 here>'
>
try:
MONTH(da_date) = xx
(MONTH() is unambiguous, plus integer compare is faster)
Regards,
--
Don Read dread@texas.net
-- The problem with people who have no vices is that you can be
sure they're going to have some pretty annoying virtues.