"Sagar" <[EMAIL PROTECTED]> wrote in message
> I hope some one will solve my problem.
> I have a table in which a field is of date type.
> i want a mysql query to get all the records of the table
> into an array of  a particular month.

Some clarification is needed: do you want all entries for
a given month of ANY year, or of a specific year?

If the first, I would use
    SELECT * FROM table
        WHERE MONTH(datefield) = mm
(See the MySQL documentation, section 7.4.11)

Or, for the second
    SELECT * FROM table
        WHERE datefield BETWEEN
            'yyyy-mm-01' AND 'yyyy-mm-31'

... how's that?

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to