2016-08-15 1 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

고맙습니다. 설명서 또한 SQL 주입이 수정 될 것입니다. –

답변

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