Check out mysql manual, section 6.3.4 - Date and Time Functions, example
$condition='';
if($GET['week']) $condition .= WEEK(date)='$_GET[week]' AND ;
if($GET['year']) $condition .= YEAR(date)='$_GET[week]' AND ;
and so on
then use the condition:
$sql = SELECT * FROM news WHERE $condition 1;
On Monday 31 March 2003 22:07, Davy Obdam wrote:
I would like to select news from my database bases on week/year and
month/year.
How can i do this.. I would like to pass two arguments in the query
string, like news.php?week=14year=2003 or news.php?month=3year=2003.
Can anybody help me..
Thanks Jason and Marek,
I was thinking to difficult, Thanks for the quick responses.
Best regards,
Davy Obdam
-Oorspronkelijk bericht-
Van: Jason Wong [mailto:[EMAIL PROTECTED]
Verzonden: maandag 31 maart 2003 16:36
Aan: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] date() and mktime
3 matches
Mail list logo