Re: multiple queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux