Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expired Date?

Status
Not open for further replies.

7724

Programmer
Feb 25, 2005
28
GB
Hi Guys,

Wondering if you could help. I have set up a php admin section where you can add ‘events’ into a MySql database and then created a page where all records saved are then pulled out of that database in DATE order on my php template page.

Now this works fine, but I was wondering if anyone knew of a clever bit of php code which I can put on the page that pulls out the data which somehow looks at the current date and if there is an ‘Event’ that has expied and happened the page will not show it?

Many Thanks

Chris
 
Here's what I use when displaying meeting dates for organizations:
Code:
$query = "Select * from meeting_dates where (to_days(date) - to_days(now()) >= 0)";
Note: the field "date" has datatype "date". (Yes, I know that isn't good programming practice)

Ken
 
I have cron job that will take edits the Valid field from 0 to 1 if a gig has passed.

Then my SELECT Code has WHERE valid="0"

Make Sense? I hope so (-:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top