I use ASP/MS-SQL, but you first need to use SQL to select the correct
records, something like:
SELECT * from TABLE WHERE StartDate <= GetDate() AND EndDate >= GetDate() -
(GetDate() is the current date)
And then use a "While not EOF" loop to step through the records, writing
them to the page.
-----Original Message-----
From: email@hidden
[mailto:email@hidden]On Behalf Of Simon Birch
Sent: 21 June 2004 23:38
To: email@hidden
Subject: Using PHP/MySQL to display data by date
Could someone recommend a good resource, either online or a book, that
explains how to display data on a web page according to the current
date using PHP/MySQL?
For example, suppose I have the following data:
Name Info StartDate
EndDate
Item 1 Description 1 2004-06-21 2004-06-22
Item 2 Description 2 2004-06-23 2004-06-24
Item 3 Description 3 2004-06-23 2004-06-26
Today is June 21, 2004. I want my web page to display Item 1 but not
Items 2 and 3. On June 23, my page displays Items 2 and 3 but Item 1
has "expired" and is no longer displayed.
I've really spent some time searching for than answer online, including
the PHP and MySQL manuals, but I can't find precisely what I'm looking
for. Be gentle if I'm an idiot and have overlooked something obvious.
Many thanks.
Simon
_______________________________________________
web-development mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/web-development
Do not post admin requests to the list. They will be ignored.
_______________________________________________
web-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/web-development
Do not post admin requests to the list. They will be ignored.