I have this code which shows all the news posts in the table. But as now i have so many posts its making the site homepage take a while to load. So i though just showing this months posts would be better. But i cant work out how to do it. The date is saved in the database as a 'date' field eg 20040323.
$result = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC") or die("FECK");
any ideas?
try here
http://www.mysql.com/documentation/mysql/bychapter/manual_Tutorial.html#Date_calculations
and here
http://www.mysql.com/documentation/mysql/bychapter/manual_Functions.html#Date_and_time_functions
and in a few days, on april 1st, you don't display any posts at all since you don't have posts created in april?
why not showing the 10 newest posts via ORDER BY datecolumn DESC LIMIT 10 ?
already thought of that. but i want to archive the news aswell so i can show all the new for any given month or year. so i'll need to know how to do it anyways.