MySQL Forums
Forum List  »  PHP

Re: Month events
Posted by: Dave Walker
Date: April 24, 2006 12:25PM

Hi, Try this:

<?
$one_week=604800;// seconds
$id = "month(now())";
$one_week_old = $id-$one_week;

$sql = "select * from agenda_geral
where agenda='desporto'
and month >= ".$one_week_old."
and month <= ".$id."
and area_ID = 1
order by day" ;
?>

The query will retrieve records made in the last 7 days.

Hope it helps ;-)

Dave

UK MySQL Web Hosting: http://www.seiretto.com

Options: ReplyQuote


Subject
Written By
Posted
April 24, 2006 11:46AM
April 24, 2006 11:58AM
April 26, 2006 03:39AM
April 26, 2006 11:43AM
Re: Month events
April 24, 2006 12:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.