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()" ?

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:

SELECT * FROM events WHERE sort_date>NOW()

Notice that you want the sort_date to be greater than NOW(), not less than.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.