note 53837 rejected from ref.datetime by sean

From: Date: Tue, 14 Jun 2005 19:16:00 +0000
Subject: note 53837 rejected from ref.datetime by sean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-90431@lists.php.net to get a copy of this message
Note Submitter: vicente dot mollon at kleinundgross dot net ---- I'm trying to get only the records of today date from a database, when I test my application the browser returns me a SQL error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '()' at line 1 And my scripts is: <?php mysql_select_db($database_noticias, $noticias); $query_noticias = "SELECT * FROM noticias WHERE fecha = Date()"; $noticias = mysql_query($query_noticias, $noticias) or die(mysql_error()); $row_noticias = mysql_fetch_assoc($noticias); $totalRows_noticias = mysql_num_rows($noticias); ?> If I delete the part: ... FROM noticias WHERE fecha = Date() the problem is over but obiously shows me all the records that I have in my table (a lot, about 3 years of 5 daily news). So, I need help, I only want to show the records that equals to TODAY's DATE Can anyone help me?

« previous php.notes (#90431) next »