Re: multiple queries

From: Date: Tue, 02 Dec 2003 01:17:25 +0000
Subject: Re: multiple queries
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-31827@lists.php.net to get a copy of this message
Hello Cameron, Tuesday, December 2, 2003, 1:08:19 AM, you wrote: CS> $sql = "SELECT * from dates where store=$store and date=$date"; CS> ultimately I would like to display data for 3 days on either side of CS> this. The following is un-tested, but a quick look over the MySQL manual should firm this up for you: SELECT * FROM dates WHERE store='$store' AND date > DATE_SUB(now(), interval 3 day) AND date < DATE_ADD(now(), interval 3 day) -- Best regards, Richard mailto:rich@launchcode.co.uk

« previous php.db (#31827) next »