Re: [PHP-DB] Select news based on dates

2004-05-17 Thread Daniel Clark
ORDER BY date, text ? > Hi! > You can use "order by date" and such method: > > $result = mysql_query(blablabla); > $date = "foo"; > while($news = mysql_fetch_array($result)){ > if ($date==$news["date"]){ > echo "new date"; > } > echo $news["text"]; > $date = $news["date"];

Re: [PHP-DB] Select news based on dates

2004-05-17 Thread Mikhail U. Petrov
Hi! You can use "order by date" and such method: $result = mysql_query(blablabla); $date = "foo"; while($news = mysql_fetch_array($result)){ if ($date==$news["date"]){ echo "new date"; } echo $news["text"]; $date = $news["date"]; } Monday, May 17, 2004, 3:50:04 PM, T. wro

Re: [PHP-DB] Select news based on dates

2004-05-17 Thread John W. Holmes
From: "T. H. Grejc" <[EMAIL PROTECTED]> > I would like to display my news like this: > > *10.04.2004.* > - news 1 > - news 2 > - news 3 > *14.04.2004.* > - news 4 > *15.04.2004.* > - news 5 > ... > > I'm thinking of some while loop but I'm not sure that it will work nor I > know how to create t

RE: [PHP-DB] Select news based on dates

2004-05-17 Thread Angelo Zanetti
use the date functions in your mysql query, read the mysql manual for it. you can also just select * from a table and group it by date so all news articles on the same date will be displayed together. Perhaps you shouls also read up about groups in SQl. hope this helps angelo -Original Messag