CODE
$query_articles = "SELECT * FROM ".db('prefix')."articles WHERE published = 1 AND category!='1' AND SUBSTRING(position, 1, 1) != '2' AND (date<=DATE_SUB(NOW(), INTERVAL 1 YEAR)) order by date desc LIMIT 1";
A strange things happen here. It was working for two days and for I get the same article for three days now. Now is 11th and I have the article from January 8th for three days. I looked at MySQL manual and I found something like this:
CODE
date=DATE_SUB(NOW(), INTERVAL 1 YEAR)
but that returns nothing. That's why I came up with such a complicated query. If anybody has any idea about fetching a record one year old I'd be very grateful.
