Jump to content

[SOLVED] Only displaying after the current date


tomhoad

Recommended Posts

Hi,

 

My query for an events page is as follows:

 

$query   = "SELECT id, venue, FROM_UNIXTIME(date, '%d/%m/%Y') as dttm, tickets FROM events WHERE date >= NOW() ORDER BY date";

 

But it returns nothing at all (no errors though). How can I get it to only select the gigs from todays date (i.e. not displaying past gigs).

 

Simple I'm sure, but I'm inexperienced!

 

Cheers.

Thanks for the replies! Neither quite worked, but pointed me in the right direction.

 

For future reference:

 

$query   = "SELECT id, venue, FROM_UNIXTIME(date, '%d/%m/%Y') as dttm, tickets FROM events WHERE  FROM_UNIXTIME(date, '%Y-%m-%d') > CURDATE() ORDER BY date"; 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.