Re: multiple queries
| From: | Gary Every | Date: | Tue, 02 Dec 2003 13:53:54 +0000 |
| Subject: | Re: multiple queries | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31838@lists.php.net to get a copy of this message | ||
Or do the same with the BETWEEN keyword:
SELECT * FROM dates WHERE store='$store' AND date BETWEEN DATE_SUB(now(),
interval 3 day) AND DATE_ADD(now(), interval 3 day)
Richard Davey wrote:
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)