clay1 Posted March 28, 2011 Share Posted March 28, 2011 This function is throwing the following error: invalid input syntax for type timestamp "1301297896" function removeInactiveUsers(){ if(!TRACK_VISITORS) return; $timeout = time()-USER_TIMEOUT*60; $result = pg_query_params($this->connection, "delete from active_users where timestamp < $1", array($timeout)); $this->calcNumActiveUsers(); } I know the problem is with $timeout using a php timestamp vs postgresql timestamp but I'm not sure how to fix that Quote Link to comment https://forums.phpfreaks.com/topic/231928-invalid-input-syntax-for-type-timestamp/ Share on other sites More sharing options...
clay1 Posted March 28, 2011 Author Share Posted March 28, 2011 $result = pg_query_params($this->connection, "delete from active_users where timestamp < to_timestamp($1)::TIMESTAMP", array($timeout)); Seems to be working Quote Link to comment https://forums.phpfreaks.com/topic/231928-invalid-input-syntax-for-type-timestamp/#findComment-1193159 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.