2016-08-15 10 views
-1

今日の日付をクエリに含める必要があります。PostgreSQL - 日付を含む

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

トランザクションテーブルには、日付列があります。

+0

Iごめんなさい:私は* 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 = ? 
関連する問題