Re: repeating data from one column until data from another column changes
| From: | Torsten Roehr | Date: | Tue, 04 May 2004 20:20:14 +0000 |
| Subject: | Re: repeating data from one column until data from another column changes | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185345@lists.php.net to get a copy of this message | ||
"Msa" <melissa@maddesignusa.com> wrote in message
news:20040504195912.37741.qmail@pb1.pair.com...
>
> "Torsten Roehr" <roehr@zilleon.com> wrote in message
> news:20040504183942.3769.qmail@pb1.pair.com...
> > I'm not quite sure if I understand your problem. Why don't you "ORDER BY
> > date desc LIMIT 0, 1" to only load the latest article? Maybe you could
> post
> > some rows of your table and show which of them you would like to load.
>
> Because there are an inspecific number of articles that need to show each
> month....I need to specify the LIMIT by the latest date...which there are
> more than one...for example:
>
> http://www.aiaky.org/articles.htm
>
> Ideally, I need, in the list on the right of the main section, for the
> titles from the current month to appear, and in the body of the page for
the
> titles of the current month, with descriptions, to appear.
So you need all articles of the current month ordered by sort, right? This
would be the select statement:
'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?