Re: Query to MySQL

From: Date: Wed, 25 Sep 2002 19:17:21 +0000
Subject: Re: Query to MySQL
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-16007@lists.php.net to get a copy of this message
I bet you it's the ' around the currentdate()-function that causes it to interpret it as a string instead of a function call. And afaik there is no currentdate()-function in mysql, it's now(). At 15:02 2002-09-25 -0400, Marlene Burckhalter wrote:
I am trying to display an event calendar in an html document ( I am a beginner, I had to start small). My problem is the following query displays all the records instead of just the ones with the event date greater than or equal to the current date. Any suggestions to a begginer? Here is a snipplet: $query = "SELECT eventmonth FROM $create_calendar_tablename
             WHERE eventdate >= 'currentdate()'
             LIMIT 19";
$result = mysql_query($query); if(!$result) error_message(sql_error()); while($query_data = mysql_fetch_array($result)) { echo $query_data["eventmonth"],"<P>"; }


« previous php.windows (#16007) next »