Jump to content

Archived

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

Guest Tim_Christopher

UTC_DATE()

Recommended Posts

Guest Tim_Christopher


 $conn = db_connect();

 $query = "SELECT eventDate, eventName FROM tblEvents WHERE eventDate >= \'UTC_DATE()\' ORDER BY eventDate";

 $result = mysql_query($query) or die(mysql_error());

 

 

How do I edit the above query to show only the events that are either greater than or equal to the current date?

 

eventDate is a date field in the database stored in yyyy-mm-dd format... Just realised that I\'m using MySQL version 4.0.1-standard, and I need 4.1.1 :-(

 

Is there an easy way to mimic UTC_DATE() using functions that are available in earlier versions?

Share this post


Link to post
Share on other sites

[php:1:9ce60bc25f]<?php

$query = \"SELECT eventDate, eventName FROM tblEvents WHERE eventDate >= CURDATE() ORDER BY eventDate\" ;

?>[/php:1:9ce60bc25f]

 

hth

Share this post


Link to post
Share on other sites

×

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.