I'm currently writing a diary type of application that will have a lot of potential puposes when completed.
My current problem, however, is that I wish to display the past 30 day's postings.
I currently have a script and sql statement to select the articles in the current month but at the start of every month the page will be blank, as new.
What I am looking for is someway to do the following:
Get todays date (I'm using the date() function)
Calculate 30 prior to this date
Select all the records (efficiently) that fall between these dates.
I currently have this code:
#
$this_month = date("Y-m");
$sql = "SELECT * FROM data WHERE date like \"$this_month-__\" ";
#
But as I said this only gives me the articles in the current month and not 30 days prior to todays date like I want.
Thanks in advance
Mike.