SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Expired Date?

  1. #1
    Non-Member
    Join Date
    Feb 2005
    Posts
    737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Expired Date?

    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

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Örebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    You should be able to filter out expired dates in your SQL query:

    Code:
    SELECT * FROM your_table WHERE date_field >= CURDATE()
    (The query above is written for MySQL, but it should give you an idea of how it can be done.)
    ERIK RIKLUND :: Yes, I've been gone quite a while.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •