sark9012
sark9012

Reputation: 5747

Timestamp before now?

Quite simply, I have the following query

$q = "SELECT fixture_date FROM ".TBL_FOOT_GAMES." WHERE leagueid = '$league_id' AND (type = '2' OR type = '12' OR type = '22' OR type = '32') GROUP BY fixture_date ORDER BY fixture_date";

I need to add a WHERE on fixture_date which is a timestamp. The where needs to be before the current moment in time.

Any ideas? Thanks :)

Upvotes: 2

Views: 103

Answers (2)

Leopold Stotch
Leopold Stotch

Reputation: 1522

WHERE fixture_date < NOW(); That should do it :)

Upvotes: 1

Brad Christie
Brad Christie

Reputation: 101614

WHERE fixture_date < NOW();

That what you're going for? timestamps can be compared like any other data type.

Upvotes: 4

Related Questions