Bug 1766 fixed : [PostgreSQL] unkown database function UNIX_TIMESTAMP()

Add a new function pwg_db_date_to_ts() to calculate a timestamp from a date

git-svn-id: http://piwigo.org/svn/trunk@6666 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou
2010-07-06 12:14:17 +00:00
parent a9849aa9b6
commit 804d79a625
5 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ function pwg_session_gc()
$query = '
DELETE
FROM '.SESSIONS_TABLE.'
WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(expiration) > '
WHERE '.pwg_db_date_to_ts('NOW()').' - '.pwg_db_date_to_ts('expiration').' > '
.$conf['session_length'].'
;';
pwg_query($query);