Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

php exclusion by date??

  • 02-02-2006 2:47pm
    #1
    Closed Accounts Posts: 8,866 ✭✭✭


    Can anyone help me, i have a php page listing items from a mysql database which all have a closing date, and i want any items that have gone past their closing date to be excluded from the list. This is achieved using the WHERE clause in php so i'll have something like

    "....WHERE sit_closing_date<"

    anybody know how i can do this?

    cheers


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    It depends on how the dates are stored in a database.

    If the dates are stored as INT (like I tend to do), then

    "...WHERE sit_closing_date > ".mktime()."....";

    Should do. If dates are stored as DATETIME or another date stamp, then

    "...WHERE sit_closing_date > NOW()"

    Should work in theory.


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Yeah their stored as DATE, i got this error when i tried your suggestion. Might try changing the date stamp to int.

    Query failed:Unknown column 'NOW' in 'where clause'


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Wait, scratch that, i got it! I didn't put the ()'s after NOW when i tried that solution! :rolleyes:

    Cheers seamus!


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    Hmmm

    /notes down


Advertisement