2013-12-10 3 views
-1

어떻게하면 1386632264처럼 타임 스탬프보다 큰 MySQL 레코드를 얻을 수 있습니까? (PHP와 MySQL)Mysql 및 html 타임 스탬프

MySQL의 타임 스탬프는

WHERE time>1386632264 

여기

나던 작품은 쿼리

select ua.user_id as member, ua.post_id, pa.user_id, pa.type, 
    pa.time, CONCAT(u.first_name,' ',u.last_name) as name,u.thumbnail 
from user_activity ua 
right join post_activity pa on ua.post_id=pa.post_id 
right join users u on pa.user_id=u.user_id 
where ua.user_id=6 and time<1386632264 
+0

'시간'열은 무엇입니까? – BenM

+1

mysql timestamp – user3038421

+0

당신이 시도한 코드는 무엇입니까? –

답변

1

가져 오기 MySQL의 UNIX_TIMESTAMPtimestamp에게있는 current_time_stamp에게 있습니다. 아래는 쿼리입니다. 예를 들어, 사용 UNIX_TIMESTAMP

select ua.user_id as member,ua.post_id,pa.user_id,pa.type,pa.time,CONCAT(u.first_name,' ',u.last_name) as name,u.thumbnail from user_activity ua right join post_activity pa on ua.post_id=pa.post_id right join users u on pa.user_id=u.user_id where ua.user_id=6 and UNIX_TIMESTAMP(time)<1386632264 
0

:

[your select instructions] WHERE UNIX_TIMESTAMP(time) >='1196440219' 

또는

[your select instructions] WHERE time >= UNIX_TIMESTAMP([your webpage date time]) 

이것은 예이다는 비교를 위해 사용되는 값은 웹 페이지에서 걸릴에 따라 달라집니다.

+0

doesnt work ... 어떻게 타임 스탬프를 2013-12-10 10:23:04 에서 13456752786으로 변환 할 수 있습니까? – user3038421

+0

업데이트 됨, 귀하의 질문에 대해 오해했습니다. 죄송합니다. – Matteo