RE: [PHP-DB] Query and Date problem

From: Date: Wed, 15 Aug 2001 17:23:21 +0000
Subject: RE: [PHP-DB] Query and Date problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11390@lists.php.net to get a copy of this message
That did it. Anybody know why? Jeff Oien > Not sure if this will make a difference, but try putting single quotes > around $today: > date != '$today' > > - Jonathan > > > -----Original Message----- > From: Jeff Oien [mailto:jeff@webdesigns1.com] > Sent: Wednesday, August 15, 2001 10:18 AM > To: PHP-DB > Subject: [PHP-DB] Query and Date problem > > > I want to retrieve the last 15 days of data from a certain time but > not today's. I have this but it's still giving me today's data: > > $today = date("Y-m-d"); > $sql = "SELECT volume, date, time, id > FROM $table_name > where time = $time1 and date != $today ORDER by id desc LIMIT 15"; > > (date != $today) code in question > > When I print $today it's: 2001-08-15 and the date field in the database > is also displaying as 2001-08-15. Any suggestions? Thanks in advance. > Jeff Oien > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#11390) next »