Jump to content


  • Please log in to reply
1 reply to this topic

#1 Guest_Tim_Christopher_*

  • Guests

Posted 27 September 2003 - 02:08 PM

 $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?

#2 Barand

  • Moderators
  • Sen . ( ile || sei )
  • 18,041 posts

Posted 27 September 2003 - 10:17 PM

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

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received


|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users