Re: repeating data from one column until data from another column changes
| From: | msa | Date: | Tue, 04 May 2004 21:48:43 +0000 |
| Subject: | Re: repeating data from one column until data from another column changes | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185347@lists.php.net to get a copy of this message | ||
> 'SELECT * FROM table WHERE YEAR(date) = ' . date('Y') . ' AND
> MONTH(date)
=
> ' . date('m') . ' ORDER BY SORT DESC'
>
> What column type is your date column of? I know that the above statement
> works with the MySQL date (YYYY-MM-DD) and datetime column types.
>
> Regards, Torsten
>
> >
> > does this help?
My date format is as above....I am getting the following error message:
You have an error in your SQL syntax. Check the manual that corresponds to
your MySQL server version for the right syntax to use near 'Y') . ' AND
MONTH(date) = ' . date('m') . ' ORDER BY sort DESC'
I changed your code to fit my table name and "sort" to be lower case, as it
is in the database:
"SELECT * FROM NewsArchive WHERE YEAR(date) = ' . date('Y') . ' AND
MONTH(date) =' . date('m') . ' ORDER BY sort DESC";
any ideas?
thanks again!!