944,123 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1667
  • PHP RSS
Nov 28th, 2005
0

Date functions

Expand Post »
I'm doing an code the would list events entered by people and it's sorted by date, what I want it to do though is to list out only those who's starting dates haven't passed yet. How should I build the query? Could it be as simple as "SELECT * FROM events WHERE sort_date < NOW()" ?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
StrikeFreedom is offline Offline
17 posts
since Aug 2005
Nov 28th, 2005
0

Re: Date functions

This is an SQL question, which belongs in the database section.

If you want to find all the records that have dates in sort_date that are after the current date, use the following query:
PHP Syntax (Toggle Plain Text)
  1. SELECT * FROM events WHERE sort_date>NOW()
Notice that you want the sort_date to be greater than NOW(), not less than.
Reputation Points: 38
Solved Threads: 25
Posting Shark
chrisbliss18 is offline Offline
902 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: folder searching
Next Thread in PHP Forum Timeline: Starting project





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC