Hi,
I have a datetime field and I am trying to find entries in my db from within the last 30 days but somehow nothing is being selected. Can anybody point out what I am doing wrong here?
Thanks
$thirty_days_ago = date(strtotime('30 days ago'));
$sql5 = "SELECT songid, stitle FROM songs WHERE sdate > '$thirty_days_ago' ORDER BY srating DESC LIMIT 75";
$rs = mysql_query($sql5, $conn);
if(mysql_num_rows($rs)) {
while ($row = mysql_fetch_array ($rs, MYSQL_ASSOC)) {
$stitle = prepOut($row['stitle']); .......
Thanks for any help. I think it has something to do with the
$thirty_days_ago = date(strtotime('30 days ago'));
and
sdate > '$thirty_days_ago'
part.
Thanks much.