RE: [PHP] date() and mktime() functions: weeknumbers and months.

2003-03-31 Thread Davy Obdam
PHP] date() and mktime() functions: > weeknumbers and months. > > > 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

Re: [PHP] date() and mktime() functions: weeknumbers and months.

2003-03-31 Thread Jason Wong
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=14&year=2003 or news.php?month=3&year=2003. > Can anybody help me.

Re: [PHP] date() and mktime() functions: weeknumbers and months.

2003-03-31 Thread Marek Kilimajer
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";