You are here: Displaying records from current month only « All PHP « IT news, forums, messages
Displaying records from current month only

Posted by chris.huh on 04/02/06 04:08

I am making a blog, and want the home page to only display the records
from the current month.
I have tried using:

SELECT id, date_format(date, '%D %M %Y') as date, title, article,
catagory, publication
FROM articles
WHERE DATE_ADD(date, INTERVAL 1 MONTH) > NOW()
ORDER BY `date` DESC

At first this seemed to work fine but then i realised that it selected
the data from every month by that name, regardless of the year that it
was in.

How do i limit it to only this current year as well as this current
month, i'm sure it's just a simple alteration but cannot figure it out.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация