i have a mysql query like that
SELECT s.end_date_time AS Finishtime
FROM auctions_search AS s
WHERE end_date_time >NOW() + INTERVAL 3 HOUR;
so i need put it into php i try like this
$aToday = date("Y-m-d H:i:s");
$aExpireAuctionTime = DBC::$slave->selectAssoc("
SELECT
s.end_date_time AS FinisDate
FROM
{$this->sDBName_Auction}.{$this->sTBLName_Auctions_Search} AS s
WHERE
s.end_date_time >{$aToday} + INTERVAL 3 HOUR
");
but giving me error like
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '08:53:24 + INTERVAL 3 HOUR'
end_date_time
column store a ending dates of items where is listed on shop
so i need select a items where they will end not more than +3
for example we have records for ending in
- 2013-08-15 09:51:38
- 2013-08-15 10:56:40
- 2013-08-29 18:56:00
- 2013-08-19 12:56:32
and current time is 2013-08-15 08:51:38
so i need select
- 2013-08-29 18:56:00
- 2013-08-19 12:56:32
cuz other one will finish after 3h
maybe query should me like
select
s.end_date_time
from
auctions_search AS s
where
true
and s.start_date_time <= 3