MySQL Query problem...

From: Date: Mon, 08 Jul 2002 20:59:00 +0000
Subject: MySQL Query problem...
Groups: php.db 
Request: Send a blank email to php-db+get-20403@lists.php.net to get a copy of this message
I seem to have run into another problem with a query that I am doing exactly like the example in the MySQL documentation, I think. The following query is not working on my PHP page, and it is not working from a MySQL command line either. This looks exactly the same as an example in the MySQL documentation though. Thanks in advance for the help again. SELECT * FROM oncall WHERE TO_DAYS(NOW()) - TO_DAYS(ptime) <= 3 This is the query that I am ultimately after: SELECT * FROM oncall ORDER BY 'ptime' ASC WHERE TO_DAYS(NOW()) - TO_DAYS(ptime) <= 3 I am trying to display all of the records from the past three days. This looks like the way to go about doing this, but if there is a better way please let me know. (Just as more info, the 'ptime' field is a datetime type of field.) Scott Nipp Phone: (214) 858-1289 E-mail: sn4265@sbc.com Web: http:\\ldsa.sbcld.sbc.com

« previous php.db (#20403) next »