Hi,
I am trying to add a menu to the front page of my site that displays recently added items. Each item is in a mysql table with a dateadded field in the format (Y-m-d).
I want to run a query that will extract say, the last month of entries. Anyone got any ideas on the query?
I tried
where this month and this year is just using the appropriate date() function.
It wont work because i'm betting that date in the mysql database can not be compared as a number. So, any other ideas?
Thanks
I am trying to add a menu to the front page of my site that displays recently added items. Each item is in a mysql table with a dateadded field in the format (Y-m-d).
I want to run a query that will extract say, the last month of entries. Anyone got any ideas on the query?
I tried
Code:
SELECT * FROM `mbs_trumps` WHERE `dateadded` > "$thisYear-$thisMonth-%" ORDER BY `dateadded` DESC
where this month and this year is just using the appropriate date() function.
It wont work because i'm betting that date in the mysql database can not be compared as a number. So, any other ideas?
Thanks