2016-08-15 110 views
-1

我需要在我的查詢中包含今天的日期。PostgreSQL - 包含日期

SELECT * 
FROM 
    transactions, machine 
WHERE 
    transactions.machineid::int8 = machine.machineid::int8 AND 
    (machine.storeid = '".$_SESSION['user_session']."') 

在交易表中是日期列。

+0

對不起:我*有*添加的SQL注入標籤(加上PHP標籤) – wildplasser

+0

https://www.postgresql.org/docs/9.1/static/functions-datetime。 html –

+1

thanx爲文檔,同時sql注入將被修復 –

回答

0
SELECT * 
FROM 
transactions, machine 
WHERE 
transactions.machineid::int8 = machine.machineid::int8 AND 
(machine.storeid = ?) 
AND date = ?