Hi,
I have a mysql table with a date time field. The date is stored like this: 2004-11-10 19:04:23.
I am trying to select entries from a range of "within the last 30 days". After searching the board it looks like strtotime is the way yo go but I can quite get the syntax right.
Here is my latest attempt:
$thirty_days_ago = date(strtotime('thirty days ago'))
//exit ($thirty_days_ago);//If i exit here it says -1 ??
$sql5 = "SELECT songid, stitle FROM songs WHERE sdate >= '$thirty_days_ago'";
But no luck. I noted where if I exit at that point it says -1. ??
Thx for any help.