How to select entries up to a certain date

They have: 11 posts

Joined: Jul 2005

Hi,

I am setting up a site that is going to display gigs of bands- how to I get Mysql/php to select only the gigs that havn't happened yet (ie those with a date with greater value then the current date,

Cheers

demonhale's picture

He has: 3,278 posts

Joined: May 2005

Since Im not really proficient with PHP/mysql...
You could do the same function with javascript

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

You can actually just use something like the following:

SELECT * FROM tablename WHERE datecolumn > TODAY();

I believe that will work.

They have: 11 posts

Joined: Jul 2005

Just tried that but it just read an error message (something to do with () at the end)- any suggestions?

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

Sorry, that should be NOW()

They have: 11 posts

Joined: Jul 2005

Excellent- all working now- thanks a mil!

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

Glad to be of service.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.